patternfly-react icon indicating copy to clipboard operation
patternfly-react copied to clipboard

Bug - DualListSelector - Updating availableOptions asynchronously raise TypeError

Open guillaumevincent opened this issue 2 years ago • 0 comments

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

guillaumevincent avatar Jun 10 '22 15:06 guillaumevincent