Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Raju/edec0a1c8cad6d58932ff608790e4202 to your computer and use it in GitHub Desktop.

Select an option

Save Raju/edec0a1c8cad6d58932ff608790e4202 to your computer and use it in GitHub Desktop.
Render 1 Render 2 State Preserved?
<>...</> <>{[...]}</> yes (in any level)
<><>...</></> <>...</> no
[...] [[...]] no
[<>...</>]* [...] no
[<>...</>]* <>...</> no
[<>...</>]* <>[...]</> no
[<>...</>]* [[...]] yes
[<>...</>]* <><>...</></> yes
<>{[...]}</> <><>...</></> no
<>{[...]}</> [[...]] no
<><>...</></> [[...]] yes (only when nested two levels from top)
<><>...</></> <><>...</></> yes
[[...]] [[...]] yes
[...] <>...</> yes (top level only)
... <>...</> yes (top level only)
... [...] yes (top level only)
  • Render warns since the fragment is unkeyed. We'll treat it as undefined behavior.

Note: The state preservation behavior is commutative of the renders; It doesn't matter whether render 1 or 2 happens first, the state preservation behavior should be the same.

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