Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frint-router-react: inline rendering via Route component #303

Merged
merged 1 commit into from Sep 19, 2017

Conversation

fahad19
Copy link
Member

@fahad19 fahad19 commented Sep 19, 2017

Closes #302

Note: No breaking changes.

What's done

The <Route /> component now supports inline rendering via render prop:

<Route
  path="/about"
  render={() => <p>Hi</p>}
/>

Doing so would allow passing extra props to the components, without risking any unmounting of the rendered components:

import Foo from './Foo';
const fooProps = {};

<Route
  path="/foo"
  render={(routeProps) => (
    <Foo 
      customProps={fooProps} 
      {...routeProps} 
    />
  )}
/>

@fahad19 fahad19 self-assigned this Sep 19, 2017
@fahad19 fahad19 requested a review from a team September 19, 2017 09:21
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 97.224% when pulling 1031478 on route-render into 416bc35 on master.

@ghost ghost self-requested a review September 19, 2017 09:33
@fahad19 fahad19 merged commit 6e5f906 into master Sep 19, 2017
@fahad19 fahad19 deleted the route-render branch September 19, 2017 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants