patternfly-react
patternfly-react copied to clipboard
Bug - DualListSelector - Updating availableOptions asynchronously raise TypeError
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