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

Possible issues with delegated rendering #2

Closed
yuchi opened this issue May 31, 2016 · 2 comments
Closed

Possible issues with delegated rendering #2

yuchi opened this issue May 31, 2016 · 2 comments
Assignees

Comments

@yuchi
Copy link

yuchi commented May 31, 2016

I’m sorry I have no time to actually test this, but I wanted to leave at least a note.

There are complex React components that expect functions as children. Those functions will be later called and of course they expect React elements to come out of those.

This means that your synchronous incremental-dom → React element transformation would happen just for the “first level” and not for the results of those functions.

ReactDOM.render(
  <Something>{ param => <span>{ param }</span> }</Something>,
  document.getElementById('something');
);
@mairatma
Copy link
Contributor

mairatma commented Jun 1, 2016

Thanks for bringing this up, I really didn't know about this use case but now I see that components like react-motion use it.

We actually currently don't even allow passing functions as children, so right now we'd probably simply ignore it completely without passing it down. But I see that even if we already accepted functions we'd have the problem you've mentioned.

I think it's possible to fix this inside metal-react though. When converting children we can wrap these functions into another that can transform the results into react elements too.

This requires enabling functions to be passed as children first, so I'll try to take care of both of these :)

@yuchi
Copy link
Author

yuchi commented Sep 1, 2017

Closing as this has moved to other issues.

@yuchi yuchi closed this as completed Sep 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants