Skip to content

Instantly share code, notes, and snippets.

View TimothyJohnK's full-sized avatar

TimothyJohnK TimothyJohnK

  • Minnesota
View GitHub Profile
@joecritch
joecritch / MyComponent.js
Last active September 29, 2021 15:16
Passing specific props in React / JSX
class MyComponent extends React.Component {
render() {
const {location, todos, users} = this.props;
//
// ... do things with your variables!
//
return (
<MyChild {...{location, todos, user}} />
// equivalent to:
// <MyChild location={location} todos={todos} user={user} />