Skip to content

No way to use getDerivedStateFromProps if state is in Ayanami #29

@Luminqi

Description

@Luminqi

When I trying to update state in render just like using getDerivedStateFromProps, the initial Ayanami state cannot be ignored. This might not be a problem, but the behavior is different with just storing state in component.

The example:
state in ayanami: https://codesandbox.io/s/ayanamiminimal-example-zw3fi?fontsize=14
state in component: https://codesandbox.io/s/test-getderivedstatefromprops-lricw?fontsize=14

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