dillon1000/react

Commit

style prop improvements

Some improvements to how style={{x:y}} is handled in React:
* ignores null styles, rather than setting them.

Codez:

    var highlighted = false;
    <div style={{color: highlighted ? 'red' : null}} />

Before:

    <div style="color:;"></div>

After:

    <div></div>

Respects that 0 has no units.
Browse files
Changed paths4 files
First-parent comparison
M src/domUtils/CSSProperty.js ModifiedM src/domUtils/CSSPropertyOperations.js ModifiedM src/domUtils/__tests__/CSSPropertyOperations-test.js ModifiedM src/domUtils/dangerousStyleValue.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…