Skip to content

Bug - DualListSelector - Updating availableOptions asynchronously raise TypeError #7538

@guillaumevincent

Description

@guillaumevincent

Describe the problem
If you update availableOptions or chosenOptions in an asynchronous function (useEffect or componentDidMount for example). The DualListSelector raise a TypeError: Converting circular structure to JSON.

We only have the issue when the availableOptions or chosenOptions is an array of React Node.

availableOptions={this.state.availableOptions.map(o=><span>{o.name}</span>)} raise the issue

availableOptions={this.state.availableOptions.map(o=>o.name)} don't

How do you reproduce the problem?
https://codesandbox.io/s/vibrant-rhodes-5e5my3?file=/index.js

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions