mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
33 lines
952 B
TypeScript
33 lines
952 B
TypeScript
import * as React from 'react';
|
|
import { View } from 'react-native';
|
|
import { TextField } from 'react-native-material-textfield';
|
|
|
|
export class Example extends React.Component {
|
|
textFieldRef = React.createRef<TextField>();
|
|
|
|
componentDidMount() {
|
|
if (this.textFieldRef.current) {
|
|
this.textFieldRef.current.focus();
|
|
this.textFieldRef.current.blur();
|
|
this.textFieldRef.current.clear();
|
|
this.textFieldRef.current.value();
|
|
this.textFieldRef.current.isFocused();
|
|
this.textFieldRef.current.isRestricted();
|
|
}
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<View>
|
|
<TextField
|
|
label="Example"
|
|
multiline
|
|
placeholder="Text when field is empty"
|
|
value="Initial value"
|
|
style={{ fontSize: 10 }}
|
|
/>
|
|
</View>
|
|
);
|
|
}
|
|
}
|