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:
Leonard Kim 2018-11-01 10:32:11 -07:00 committed by Leonard Kim
parent d5fb2c2717
commit 3a32f7f3f0
1 changed files with 2 additions and 2 deletions

View File

@ -109,7 +109,7 @@ class AudioRoutePickerDialog extends Component<Props, State> {
state = { state = {
/** /**
* Available audio devices, it will be set in * Available audio devices, it will be set in
* {@link #componentWillMount()}. * {@link #componentDidMount()}.
*/ */
devices: [] devices: []
}; };
@ -132,7 +132,7 @@ class AudioRoutePickerDialog extends Component<Props, State> {
* *
* @inheritdoc * @inheritdoc
*/ */
componentWillMount() { componentDidMount() {
AudioMode.getAudioDevices().then(({ devices, selected }) => { AudioMode.getAudioDevices().then(({ devices, selected }) => {
const audioDevices = []; const audioDevices = [];