I am using react v15.1 and it's got this small change where null value props throws the following error:
The console log isn't very helpful, what's a better way to find out in which component this null value props is located?
Thank you
Besides, you can use the static function getDerivedStateFromError(error) to update the state and use the render() method to display a fallback UI if an error occurs. An example error boundary component is shown below. After that, you only need to wrap the required component(s) inside the error boundary component.
With the new feature in React, developers can test the Error Boundaries by a toggle error button, added to the DevTools. When we click on the toggle error button on the component labeled 'Inner Component', Error boundary is triggered.
In order to use Error Boundary in Functional Component, I use react-error-boundary. When we run this application, we will get a nice error display form the content of ErrorHandler component. React error boundary catches any error from the components below them in the tree.
Future versions of React will treat as a request to clear the input. However, React 0.14 has been ignoring value={null}. React 15 warns you on a null input value and offers you to clarify your intention. To fix the warning, you may explicitly pass an empty string to clear a controlled input, or pass undefined to make the input uncontrolled. https://facebook.github.io/react/blog/2016/04/07/react-v15.html
Details is here https://github.com/facebook/react/pull/5048/commits
You can either use breakpoint or manually check all components that have input, select or textarea within the page
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With