|
@@ -32,6 +32,19 @@ type State = {
|
32
|
32
|
* @extends Component
|
33
|
33
|
*/
|
34
|
34
|
class Labels extends AbstractLabels<Props, State> {
|
|
35
|
+ /**
|
|
36
|
+ * Updates the state for whether or not the filmstrip is transitioning to
|
|
37
|
+ * a displayed state.
|
|
38
|
+ *
|
|
39
|
+ * @inheritdoc
|
|
40
|
+ */
|
|
41
|
+ static getDerivedStateFromProps(props, prevState) {
|
|
42
|
+ return {
|
|
43
|
+ filmstripBecomingVisible: !prevState.filmstripBecomingVisible
|
|
44
|
+ && props._filmstripVisible
|
|
45
|
+ };
|
|
46
|
+ }
|
|
47
|
+
|
35
|
48
|
/**
|
36
|
49
|
* Initializes a new {@code Labels} instance.
|
37
|
50
|
*
|
|
@@ -46,22 +59,6 @@ class Labels extends AbstractLabels<Props, State> {
|
46
|
59
|
};
|
47
|
60
|
}
|
48
|
61
|
|
49
|
|
- /**
|
50
|
|
- * Updates the state for whether or not the filmstrip is being toggled to
|
51
|
|
- * display after having being hidden.
|
52
|
|
- *
|
53
|
|
- * @inheritdoc
|
54
|
|
- * @param {Object} nextProps - The read-only props which this Component will
|
55
|
|
- * receive.
|
56
|
|
- * @returns {void}
|
57
|
|
- */
|
58
|
|
- componentWillReceiveProps(nextProps) {
|
59
|
|
- this.setState({
|
60
|
|
- filmstripBecomingVisible: nextProps._filmstripVisible
|
61
|
|
- && !this.props._filmstripVisible
|
62
|
|
- });
|
63
|
|
- }
|
64
|
|
-
|
65
|
62
|
/**
|
66
|
63
|
* Implements React's {@link Component#render()}.
|
67
|
64
|
*
|