Skip to content

Instantly share code, notes, and snippets.

@olegkalyta
Created December 16, 2017 19:08
Show Gist options
  • Save olegkalyta/0d2708e20c2c259efb7599cdb4409d4a to your computer and use it in GitHub Desktop.
Save olegkalyta/0d2708e20c2c259efb7599cdb4409d4a to your computer and use it in GitHub Desktop.
const newProps = { ...rest }
if (mapFetchedDataTo) {
delete newProps.data
newProps[mapFetchedDataTo] = this.props.data
}
const chidlrenWithProps = cloneElement(children, newProps)
const dataValidationErrors = this.getRequiredDataErrors()
if (dataValidationErrors.length > 0) {
return <div>{dataValidationErrors}</div>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment