ref(audio-picker): fetch audio devices after mount
Per react migration docs, initially fetching external data is recommended to be done in componentDidMount.
This commit is contained in:
parent
d5fb2c2717
commit
3a32f7f3f0
|
@ -109,7 +109,7 @@ class AudioRoutePickerDialog extends Component<Props, State> {
|
|||
state = {
|
||||
/**
|
||||
* Available audio devices, it will be set in
|
||||
* {@link #componentWillMount()}.
|
||||
* {@link #componentDidMount()}.
|
||||
*/
|
||||
devices: []
|
||||
};
|
||||
|
@ -132,7 +132,7 @@ class AudioRoutePickerDialog extends Component<Props, State> {
|
|||
*
|
||||
* @inheritdoc
|
||||
*/
|
||||
componentWillMount() {
|
||||
componentDidMount() {
|
||||
AudioMode.getAudioDevices().then(({ devices, selected }) => {
|
||||
const audioDevices = [];
|
||||
|
||||
|
|
Loading…
Reference in New Issue