Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

ref(live-streaming): remove picker state to remove componentWillReceiveProps

Leonard Kimd6216f21d5c2
diff --git a/react/features/recording/components/LiveStream/AbstractStreamKeyForm.js b/react/features/recording/components/LiveStream/AbstractStreamKeyForm.js
index 0a393267e8..278a03c74e 100644
--- a/react/features/recording/components/LiveStream/AbstractStreamKeyForm.js
+++ b/react/features/recording/components/LiveStream/AbstractStreamKeyForm.js
@@ -33,24 +33,13 @@ export type Props = {
value: string
};
-/**
- * The state of the component.
- */
-type State = {
-
- /**
- * The value entered in the field.
- */
- value: string
-}
-
/**
* An abstract React Component for entering a key for starting a YouTube live
* stream.
*
* @extends Component
*/
-export default class AbstractStreamKeyForm extends Component<Props, State> {
+export default class AbstractStreamKeyForm extends Component<Props> {
helpURL: string;
/**
@@ -61,10 +50,6 @@ export default class AbstractStreamKeyForm extends Component<Props, State> {
constructor(props: Props) {
super(props);
- this.state = {
- value: props.value
- };
-
this.helpURL = (typeof interfaceConfig !== 'undefined'
&& interfaceConfig.LIVE_STREAMING_HELP_LINK)
|| LIVE_STREAMING_HELP_LINK;
@@ -73,17 +58,6 @@ export default class AbstractStreamKeyForm extends Component<Props, State> {
this._onInputChange = this._onInputChange.bind(this);
}
- /**
- * Implements {@code Component}'s componentWillReceiveProps.
- *
- * @inheritdoc
- */
- componentWillReceiveProps(newProps: Props) {
- this.setState({
- value: newProps.value
- });
- }
-
_onInputChange: Object => void
/**
@@ -99,9 +73,6 @@ export default class AbstractStreamKeyForm extends Component<Props, State> {
_onInputChange(change) {
const value = typeof change === 'object' ? change.target.value : change;
- this.setState({
- value
- });
this.props.onChange(value);
}
}
diff --git a/react/features/recording/components/LiveStream/native/StreamKeyForm.js b/react/features/recording/components/LiveStream/native/StreamKeyForm.js
index 91606ff627..a97e9e52b2 100644
--- a/react/features/recording/components/LiveStream/native/StreamKeyForm.js
+++ b/react/features/recording/components/LiveStream/native/StreamKeyForm.js
@@ -50,7 +50,7 @@ class StreamKeyForm extends AbstractStreamKeyForm {
onChangeText = { this._onInputChange }
placeholder = { t('liveStreaming.enterStreamKey') }
style = { styles.streamKeyInput }
- value = { this.state.value } />
+ value = { this.props.value } />
<TouchableOpacity
onPress = { this._onOpenHelp }
style = { styles.streamKeyHelp } >
diff --git a/react/features/recording/components/LiveStream/web/StreamKeyForm.js b/react/features/recording/components/LiveStream/web/StreamKeyForm.js
index 9ce96d6212..334029d003 100644
--- a/react/features/recording/components/LiveStream/web/StreamKeyForm.js
+++ b/react/features/recording/components/LiveStream/web/StreamKeyForm.js
@@ -51,7 +51,7 @@ class StreamKeyForm extends AbstractStreamKeyForm {
placeholder = { t('liveStreaming.enterStreamKey') }
shouldFitContainer = { true }
type = 'text'
- value = { this.state.value } />
+ value = { this.props.value } />
{ this.helpURL
? <div className = 'form-footer'>
<a