Skip to content

Instantly share code, notes, and snippets.

@DoctorDerek
Last active November 27, 2020 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DoctorDerek/252186d5713ddf4010d38a945a1b146a to your computer and use it in GitHub Desktop.
Save DoctorDerek/252186d5713ddf4010d38a945a1b146a to your computer and use it in GitHub Desktop.
ChildComponent.jsx - How to Pass All Props to a Child Component in React
import React from "react"
import DisplayAllProps from "./DisplayAllProps"
const ChildComponent = (props) => (
<React.Fragment>
<h1>ChildComponent's props:</h1>
<DisplayAllProps {...props}></DisplayAllProps>
</React.Fragment>
)
export default ChildComponent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment