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

Support passing elements in props #103

Closed
nippur72 opened this issue Feb 16, 2016 · 1 comment
Closed

Support passing elements in props #103

nippur72 opened this issue Feb 16, 2016 · 1 comment

Comments

@nippur72
Copy link
Contributor

React allows to pass entire elements in props but that is not possible with react-templates.

Consider for example the following template:

<Menu>
  <MenuItem>aubergine</MenuItem>
  <MenuItem>butternut squash</MenuItem>
  <MenuItem>clementine</MenuItem>
</Menu>

in react documentation they suggest to use a Context or alternatively:

Recall that you can also pass entire React components in props if you'd like to.

Now what I propose is that we create a special tag <props> to be used like this:

<Menu>
  <props ref="subitems">    
    <MenuItem>aubergine</MenuItem>
    <MenuItem>butternut squash</MenuItem>
    <MenuItem>clementine</MenuItem>
  </props>
</Menu>

meaning that the <MenuItem>s will be available as this.props.subitems.

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

No branches or pull requests

1 participant