* Ensure value and defaultValue do not assign functions and symbols * Eliminate assignProperty method from ReactDOMInput * Restore original placement of defaultValue reservedProp * Reduce branching. Make assignment more consistent * Control for warnings in symbol/function tests * Add boolean to readOnly assignments * Tweak the tests * Invalid value attributes should convert to an empty string * Revert ChangeEventPlugin update. See #11746 * Format * Replace shouldSetAttribute call with value specific type check DOMProperty.shouldSetAttribute runs a few other checks that aren't appropriate for determining if a value or defaultValue should be assigned on an input. This commit replaces that call with an input specific check. * Remove unused import * Eliminate unnecessary numeric equality checks (#11751) * Eliminate unnecessary numeric equality checks This commit changes the way numeric equality for number inputs works such that it compares against `input.valueAsNumber`. This eliminates quite a bit of branching around numeric equality. * There is no need to compare valueAsNumber * Add test cases for empty string to 0. * Avoid implicit boolean JSX props * Split up numeric equality test to isolate eslint disable command * Fix typo in ReactDOMInput test * Add todos * Update the attribute table
Attribute Behavior Fixture
WIP: This is an MVP, still needs polish.
Known Issues
- There are currently two errors thrown when the page loads;
SyntaxError: missing ; before statement
Instructions
cd fixtures/attribute-behavior && yarn install && yarn start
Interpretation
Each row is an attribute which could be set on some DOM component. Some of them are invalid or mis-capitalized or mixed up versions of real ones. Each column is a value which can be passed to that attribute. Every cell has a box on the left and a box on the right. The left box shows the property (or attribute) assigned by React 15.*, and the right box shows the property (or attribute) assigned by the latest version of React 16.
Right now we use a purple outline to call out cases where the assigned property (or attribute) has changed between React 15 and 16.
This project was bootstrapped with Create React App.
You can find the guide for how to do things in a CRA here.