Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
DisplayAllProps.jsx - How to Pass All Props to a Child Component in React
import React from "react"
const DisplayAllProps = (props) => (
<table>
<tbody>
{Array.from(Object.entries(props)).map(([key, value]) => (
<tr key={key + Math.random()}>
<td>{key}</td>
<td>{value}</td>
</tr>
))}
</tbody>
</table>
)
export default DisplayAllProps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment