Latest release delete precomputeStyle module?
redbox report 'unknown module precomputeStyle'
+1 is there a replacement for precomputeStyle?
This used to work, but now doesn't:
var precomputeStyle = require('precomputeStyle');

Wondering the same thing over here
Looks like this commit by @sebmarkbage https://github.com/facebook/react-native/commit/6244fd003de4eb6ce7fc7c40632948bf27cca201#diff-459f28dd7480110d5d268af6f1204452
It was a private module so technically we shouldn't have been using it :) Is there a good alternative to use in native modules?
Yeah, I know it was private, but people were using it (even though technically maybe we shouldn't have) It was useful. Is there an alternative?
Maybe it should get made into a public class method of StyleSheet, like StyleSheet.precomputeStyle
Why and how were you using it exactly?
It may product a result that may not be idempotent (in the mathematical sense). I.e. there may not be a public API that you can pass it to because it would be computed again.
Here's an example that was using it:
https://github.com/brentvatne/react-native-scrollable-tab-view/commit/c111d7746a87b7cebe07e90e3d73eede4970df53#diff-c7ac8c6ffd293d4101dad4033eedd5f7
(The function setAnimationValue uses it.)
I am facing same problem :) . I am also using react-native-scrollable-tab-view
I think that was an invalid use of precomputeStyle. Perhaps due to a misunderstanding of the setNativeProps API. @brentvatne Could you clarify why it was needed since it was already doing that here?
https://github.com/facebook/react-native/blob/6f17dba39b447a540491ce7f8e6256a59ea2d4c5/Libraries/ReactIOS/NativeMethodsMixin.js#L80
And is still doing it. What breaks if you just remove the call?
It also broke this popular scroll refresher component https://github.com/syrusakbary/react-native-refresher/issues/14
+1
Sorry I just saw this -- I believe the reason why I did this is very silly, you guessed it @sebmarkbage.
I didn't realize at the time that I should have used the style key for style props: setNativeProps({style: {transform: [...etc]}}).
This is probably because setNativeProps let me get away with directly passing in style properties like setNativeProps({left: 5}) for everything except transform. Of course now it is obvious to me why -- setNativeProps ran precomputeStyle on the style object passed in, which then precomputed the transform matrix. :stuck_out_tongue:
So yeah, precomputeStyle isn't needed anymore.