I did a simple test on my local setup, with RN 0.62.2:
const styles = Stylesheet.create({
container: {
flex: 1
}
});
console.log(styles);
Given that in theory Stylesheet is caching the style, I expected a log like this:
{
container: 120
}
But actually it returns the object:
{
container: { flex: 1 }
}
Then I tried the same with an expo app (https://snack.expo.io/@agustito37/4a556c) with the same version of RN, and the result was the expected:
{
container: 120
}
So I am a little confused, some people argue that caching was removed (What is the point of StyleSheet.create); but given expo is returning the identifier I am not sure, is Stylesheet.create working properly or not? Why do I have different results with expo? Could it be that expo has an older version of Stylesheet?