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

Use of React.Children.only() #48

Open
AdamBoxall opened this issue Oct 11, 2017 · 2 comments · May be fixed by #53
Open

Use of React.Children.only() #48

AdamBoxall opened this issue Oct 11, 2017 · 2 comments · May be fixed by #53

Comments

@AdamBoxall
Copy link

Is the use of React.Children.only() necessary? It enforces more mark-up.

<DocumentTitle title="...">
  <div>
    <div>...</div>
    <div>...</div>
  </div>
</DocumentTitle>

Instead of just:

<DocumentTitle title="...">
  <div>...</div>
  <div>...</div>
</DocumentTitle>

Containers are no longer required in React v16, so it would be nice to avoid having them here, too.

@dvislov
Copy link

dvislov commented Nov 17, 2017

👍

@browniefed
Copy link

For those that stumble upon this you can simple use the new Fragment from React.

import React { Fragment } from "react"

<DocumentTitle title="...">
  <Fragment>
    <div>...</div>
    <div>...</div>
  </Fragment>
</DocumentTitle>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants