Day: March 29, 2020

React State

Props are immutable and once the component is rendered you can not change the value of the Prop So how to do change the UI values ? This is where React sate comes into play When the state object changes, the component re-renders ´╗┐How to create state object´╗┐

Read more

Validate React Prop

You can validate the property of a React component using the built in PropTypes

When i pass the following props to the component When there are validation errors they will be shown in the console as warning message Warning: Failed prop type: Invalid prop rowsperpage of type string supplied to Setting, expected number.

Read more

Defaults Props in React Js

You can assign default values for properties of your components. When you do not supply prop values externally to the component default values are applied

You can Setting.defaultProps object is used to define the default properties. defaultProps is declared outside of the class or we call them instance of the class This is your […]

Read more