-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Masked TextFields to behave as controlled component when value prop i…
…s used (#281) * Mask can now support controlled TextFields. ESLint is yelling at me at the moment, but I want to get these changes into version control before I start trying alternatives that will make ESLint happy. * This checks to see if our React version supports getDerivedStateFromProps in componentDidUpdate to kind of polyfill the new lifecycle method. A more official alternative would be https://github.com/reactjs/react-lifecycles-compat. I don't really like the idea of either. I'm undecided as of yet whether to introduce the polyfill or to just continue to use componentDidUpdate in all cases with a note about changing it in the future when we know all our users are using 16.3+ * This is a working example with a polyfill. * Got rid of the compiled version and fixed eslint errors * Resetting the example to master because we don't actually want it in the docs site. * But we do want to be clear that the examples are uncontrolled components * Add unit tests * Moved maskValue above the component because that's where the other un-exported helper functions are.
- Loading branch information
Showing
6 changed files
with
1,083 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.