Components are PascalCased

Use React Plugin for ESLint

useState only for dynamic data.

React : Examples
Forward Props in Groups

Here is a basic example of forwarding 'props' with a 'Dialog' that we want to make 'Draggable'. We are wrapping the 'Dialog' component with a 'Draggable' component that will make it able to drag to different position in the 'View Port'. We do not need to use any of the 'props' except 'label' in the wrapper so we just forward them all to the child component.

This is a more advanced example where we are forwarding a group of props that we are getting from a formik object, that uses a function to get a specific group of props.

Please Login or Register to comment