Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

How does React Natives Stylesheet.create work?

$
0
0

Here is the code for the create method.

  create<+S: ____Styles_Internal>(obj: S): $ReadOnly<S> {    // TODO: This should return S as the return type. But first,    // we need to codemod all the callsites that are typing this    // return value as a number (even though it was opaque).    if (__DEV__) {      for (const key in obj) {        if (obj[key]) {          Object.freeze(obj[key]);        }      }    }    return obj;  },

How does this function work and what does the <+ operator do?


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>