Skip to content

Instantly share code, notes, and snippets.

@parwatcodes
Created July 8, 2019 11:17
Show Gist options
  • Save parwatcodes/23d7c4c6f714fe234e39969d65d2e1ab to your computer and use it in GitHub Desktop.
Save parwatcodes/23d7c4c6f714fe234e39969d65d2e1ab to your computer and use it in GitHub Desktop.
react-inline-conditionally-pass-prop-to-component
const { editable, editableOpts } = this.props;
return (
<Child {...(editable && { editable: editableOpts } )} />
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment