Uh oh!
There was an error while loading. Please reload this page.
[RFC: Docs] Add DirectManipluation guide to explain setNativeProps - #1656
Conversation
There was a problem hiding this comment.
setNativeProps is best used for continuous animations, to avoid the overhead of rendering the component hierarchy and reconciling many views. I believe we want to discourage it from an API perspective since it is imperative and stores state in the native layer (DOM, UIView, etc.)
There was a problem hiding this comment.
👍 should have mentioned the continuous animations use case
There was a problem hiding this comment.
also should be sure to emphasize more that this shouldn't be something that you use frequently outside of that use case
ccheever
commented
Jun 18, 2015
Random nitpick: At a higher level, I would change the framing of "Only use this if you really need to" to more of a "When to use this and when not to and why not". I generally agree with @ide that performance is the main reason to use it, and that you are trading off complexity of implementation for small -- but sometimes critically important -- gains in UI smoothness, etc. Overall, I think this is awesome! I think that this will go along way to making bits of React Native less mysterious and get more people building good stuff on it. |
brentvatne
commented
Jun 18, 2015
Great point @ccheever - updated accordingly |
brentvatne
commented
Jun 18, 2015
[Docs] Add DirectManipluation guide to explain setNativeProps
If someone could read this over and give me some feedback it would be much appreciated.
Addresses #1390