Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
React inline style rendering

Rendering a style update

  1. Unset previous props.

Iterate over lastStyle and copy keys into styleUpdates with empty string as a value in order to "unset" them when they are missing in the next style version.

  1. Find modified props.

Iterate over new style and copy modified keys only into styleUpdates.

  1. Render style value

Ensure valid property name and value, add default unit. Set each prop to the node.style object.

Owner

kof commented Apr 5, 2016

When is createMarkupForStyles used, first time rendering?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment