Skip to content

Add keys to models so React doesn't complain of child arrays requiring them #255

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

Closed
rmorshea opened this issue Dec 18, 2020 · 3 comments
Closed
Assignees

Comments

@rmorshea
Copy link
Collaborator

I think this is causing unexpected behavior in various places.

@rmorshea
Copy link
Collaborator Author

Without something like JSX it's just not possible to create keys on the Python side. I'm still not sure if doing JSX in Python is even a good idea, hence #282.

The only way to fix this for now is to generate unique keys in the client for each child element unless they've been explicitly set.

@rmorshea rmorshea reopened this Feb 13, 2021
@rmorshea
Copy link
Collaborator Author

Never mind this needs to be solved server-side since the client doesn't know the identity of the elements. TBH though I don't really know why this isn't already causing bugs. I'm able to change the order of children without experiencing any side effects. Maybe React is just being smart and knows how to solve the problem cases I'm presenting it with?

@rmorshea
Copy link
Collaborator Author

This is now done.

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