2015-05-02 17:09:36 +00:00
|
|
|
/**
|
2017-05-06 03:50:47 +00:00
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
2015-05-02 17:09:36 +00:00
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-05-02 17:09:36 +00:00
|
|
|
*
|
|
|
|
* @providesModule TextUpdateTest
|
|
|
|
* @flow
|
|
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
|
2016-04-09 03:36:40 +00:00
|
|
|
var React = require('react');
|
2017-07-07 21:24:25 +00:00
|
|
|
var createReactClass = require('create-react-class');
|
2016-04-09 03:36:40 +00:00
|
|
|
var ReactNative = require('react-native');
|
2017-09-06 10:25:01 +00:00
|
|
|
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
|
|
|
|
* found when Flow v0.54 was deployed. To see the error delete this comment and
|
|
|
|
* run Flow. */
|
2015-05-02 17:09:36 +00:00
|
|
|
var TimerMixin = require('react-timer-mixin');
|
|
|
|
var {
|
|
|
|
NativeModules,
|
|
|
|
StyleSheet,
|
|
|
|
Text,
|
2016-04-09 03:36:40 +00:00
|
|
|
} = ReactNative;
|
2015-05-02 17:09:36 +00:00
|
|
|
|
|
|
|
var TestManager = NativeModules.TestManager || NativeModules.SnapshotTestManager;
|
|
|
|
|
2017-07-07 21:24:25 +00:00
|
|
|
var TextUpdateTest = createReactClass({
|
|
|
|
displayName: 'TextUpdateTest',
|
2015-05-02 17:09:36 +00:00
|
|
|
mixins: [TimerMixin],
|
|
|
|
getInitialState: function() {
|
|
|
|
return {seeMore: true};
|
|
|
|
},
|
|
|
|
componentDidMount: function() {
|
|
|
|
this.requestAnimationFrame(
|
2016-11-04 12:40:26 +00:00
|
|
|
() => this.setState({seeMore: false}, () => {
|
|
|
|
TestManager.markTestCompleted();
|
|
|
|
})
|
2015-05-02 17:09:36 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
render: function() {
|
|
|
|
return (
|
|
|
|
<Text
|
|
|
|
style={styles.container}
|
|
|
|
onPress={() => this.setState({seeMore: !this.state.seeMore})}>
|
|
|
|
<Text>Tap to see more (bugs)...</Text>
|
2015-05-02 17:09:37 +00:00
|
|
|
{this.state.seeMore && 'raw text'}
|
2015-05-02 17:09:36 +00:00
|
|
|
</Text>
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
var styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
margin: 10,
|
|
|
|
marginTop: 100,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = TextUpdateTest;
|