Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions lib/Underline.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,8 @@ export default class Underline extends Component {
};
this.wrapperWidth = 0;
}
componentDidMount() {
requestAnimationFrame(() => {
if (this.refs.wrapper == null) {
return;
}
const container = this.refs.wrapper; // un-box animated view
container.measure((left, top, width, height) => {
this.wrapperWidth = width;
});
});
measure(e) {
this.wrapperWidth = e.nativeEvent.layout.width
}
expandLine() {
Animated.timing(this.state.lineLength, {
Expand All @@ -43,7 +35,7 @@ export default class Underline extends Component {
style={[styles.underlineWrapper, {
backgroundColor: borderColor
}]}
ref="wrapper"
onLayout={this.measure.bind(this)}
>
<Animated.View
style={[{
Expand Down