Content(children, [name])

Component to provide slot content. If no name prop provided, content will be considered as default. Should be used within templated component, otherwise will just render its children.

Params

  • children React.node - slot content
  • [name] string - slot name

Description

To provide content for slots from Slot example:

// App.js
import { Content } from 'react-templated';
import Page from './Page';

export default () => (
    <Page>
        <Content name="header">Header content</Content>
        <Content name="footer">Footer content</Content>
        Body content
        <Content>Additional body content</Content>
    </Page>
);

results matching ""

    No results matching ""