mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Add example for how to use style properly
Test Plan: jest
This commit is contained in:
@@ -69,7 +69,8 @@ function assertValidProps(props) {
|
||||
invariant(
|
||||
props.style == null || typeof props.style === 'object',
|
||||
'The `style` prop expects a mapping from style properties to values, ' +
|
||||
'not a string.'
|
||||
'not a string. For example, style={{marginRight: spacing + \'em\'}} when ' +
|
||||
'using JSX.'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -353,7 +353,8 @@ describe('ReactDOMComponent', function() {
|
||||
mountComponent({ style: 'display: none' });
|
||||
}).toThrow(
|
||||
'Invariant Violation: The `style` prop expects a mapping from style ' +
|
||||
'properties to values, not a string.'
|
||||
'properties to values, not a string. For example, ' +
|
||||
'style={{marginRight: spacing + \'em\'}} when using JSX.'
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -398,7 +399,8 @@ describe('ReactDOMComponent', function() {
|
||||
React.render(<div style={1}></div>, container);
|
||||
}).toThrow(
|
||||
'Invariant Violation: The `style` prop expects a mapping from style ' +
|
||||
'properties to values, not a string.'
|
||||
'properties to values, not a string. For example, ' +
|
||||
'style={{marginRight: spacing + \'em\'}} when using JSX.'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user