Skip to content

Instantly share code, notes, and snippets.

@everdimension
Created September 19, 2017 15:42
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 everdimension/bc65f869c2044db58340d711bc8b6c26 to your computer and use it in GitHub Desktop.
Save everdimension/bc65f869c2044db58340d711bc8b6c26 to your computer and use it in GitHub Desktop.
const ActuallyUsedComponent = () => (
<div>
/* some layout and markup that doesn't depend on global state */
<Connect mapStateToProps={mapStateToProps} mapPropsToActions={actions}>
/* some markup where the props from connect are actually needed */
</Connect>
<Route
path="..."
component={() => (
<div>
/*
* something that actually needs to be rendered for this path,
* usually you just provide a reference to a component
*/
<Intl>
/* some markup that actually needs Intl */
</Intl>
<Connect mapStateToProps={mapStateToProps}>
/*
* Another place where connect is needed,
* may be it even gets another state slice
*/
</Connect>
</div>
)}
/>
</div>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment