[Modern] shouldComponentUpdate returns true for empty array props using @relay(plural: true)
Open
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
When a fragment container specifies a prop as plural using `@relay(plural: true)`, `shouldComponentUpdate` incorrectly returns true (assuming no other props) if the prop had an empty array as its value both before and after the re-render. It works as intended if the array has at least one item (returns false if the items are the same before and after).
This can be circumvented by passing null instead of empty arrays as props, but it's not an ideal solution.
Contributor guide
Assessment
This issue has not been assessed yet.