Skip to content

Special syntax for child functions #104

Closed
@Lenne231

Description

@Lenne231

It would be nice to have a special syntax for child functions.

i.e.

<ThemeContext.Consumer>
  <(theme)>
    <h1 style={{color: theme === 'light' ? '#000' : '#fff'}}>
      {this.props.children}
    </h1>
  </>
</ThemeContext.Consumer>

instead of

<ThemeContext.Consumer>
  {theme => (
    <h1 style={{color: theme === 'light' ? '#000' : '#fff'}}>
      {this.props.children}
    </h1>
  )}
</ThemeContext.Consumer>

Metadata

Metadata

Assignees

No one assigned

    Labels

    ProposalProposals (haven't confirmed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions