Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
ParentComponent.jsx - How to Pass All Props to a Child Component in React
import React from "react"
import DisplayAllProps from "./DisplayAllProps"
import ChildComponent from "./ChildComponent"
const ParentComponent = (props) => (
<h1>ParentComponent's props:</h1>
<DisplayAllProps {...props}></DisplayAllProps>
<ChildComponent {...props}></ChildComponent>
export default ParentComponent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment