-
Notifications
You must be signed in to change notification settings - Fork 116
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
Is it possible to use Server Side Rendering for components that you want to pass children to? #71
Comments
You could implement something like that with React components if you use the An alternative might be to re-implement the render server's js file with your own. If you're interested, it's pretty succinct and should be easy to hack on |
I've linked this question from the README. https://github.com/markfinger/python-react/blob/master/README.md#how-do-i-pass-child-components-to-the-root-component Everyone should feel free to continue the discussion, if so inclined. |
I was able to get this to work, but would be open to any suggestions if someone knows a better way. I modified the render server's js file from:
to
I came up with this after looking at the code inside |
@ryapapap that seems pretty reasonable. The primary benefits of react-render is If you want more granular control of the render process, but still use the req/res conventions + handling in python-react, you could always just remove the Either way, @ryapapap's code above should work well enough for most purposes. |
That makes a lot of sense, thanks for the info! |
As I understand from the docs you can only pass the absolute url of a jsx file and pass props. Would it also be possible to pass child components to the server side renderer? Or would a somewhat workaround be to create another jsx file that has these child components in it and pass props?
The text was updated successfully, but these errors were encountered: