Skip to content

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

Closed

Description

@rmorshea

I think this is causing unexpected behavior in various places.

Activity

  1. self-assigned this
    on Dec 18, 2020
  2. rmorshea commented on Feb 13, 2021

    @rmorshea
    CollaboratorAuthor

    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.

  3. rmorshea commented on Feb 13, 2021

    @rmorshea
    CollaboratorAuthor

    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?

  4. rmorshea commented on Jul 16, 2021

    @rmorshea
    CollaboratorAuthor

    This is now done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions