title: TextInput length counter in react-native
body: <p>I have a TextInput with maxLength 100 in my scene, and I want to add a counter below which shows something like "38/100", auto-updating with 'onChangeText'.</p>
  
  <p>So I have to figure out the length of the input value, somehow store it in this.state.textLength while storing the value itself to this.state.text, but I don't know how to do this in "onChangeText = {(text) => ...}" function.</p>
  
  <p>Here is my simplified code:</p>
  
  <pre><code>export class RequestScene extends Component {
    constructor() {
      super();
  
      this.state={
        text: '',
        textLength: 0,
        category: '',
        time: ''
      };
    }
  
    render(){
  
      return(
        &lt;View style={{
          flex: 1,
          flexDirection: 'column',
          justifyContent: 'center',
          alignItems: 'center'
        }}&gt;
          &lt;View style={{
              height: 200
          }}&gt;
              &lt;TextInput style={{
                  height: 200,
                  width: 360,
                  borderColor: 'lightgray',
                  borderWidth: 1,
                  padding: 3,
                  borderRadius: 3,
                  fontSize: 24}}
                  maxLength={100}
                  placeholder='무슨 상황인지 간단하게 써주세요'
                  multiline={true}
  
                  // this is where I am stuck. What should I do with 'textLength'?
                  onChangeText={
                      (text)=&gt;this.setState({text})
                      (text)=&gt;this.setState({textLength})
                  }
              /&gt;
              &lt;Text style={{
                  fontSize:10,
                  color:'lightgrey',
                  textAlign: 'right'
              }}&gt; 
                  // currently this counter only shows '0/100'
                  {this.state.textLength}/100 
              &lt;/Text&gt;
  </code></pre>