Skip to content

Provider only accepts a single child #24

Closed
@TimoStaudinger

Description

Currently, the Provider component accepts only a single child:

render() {
  return React.Children.only(this.props.children);
}

This somewhat messes with our implementation, and also seems to render the example in the readme invalid:

import Toolbar from './Toolbar';
import Feature from './Feature';

import { Provider } from 'react-slot-fill';

const App = () =>
  <Provider>
    <Toolbar />
    <Feature />
  </Provider>

ReactDOMFiber.render(
  <App />,
  document.getElementById('root')
);

Did I misunderstand any of this? Is there a reason why the library would not allow multiple children for Provider?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions