title: Typescript/React-Native: Argument of type 'string | null' is not assignable to parameter of type 'SetStateAction<never[]>'
body: <p>I am learning <code>typescript</code> with <code>React-Native</code> and I want to use <code>AsyncStorage</code> library. When setting my state after reading value from the storage, I got this problem:</p>
  <blockquote>
  <p>const value: string | null Argument of type 'string | null' is not
  assignable to parameter of type 'SetStateAction&lt;never[]&gt;'.   Type
  'null' is not assignable to type 'SetStateAction&lt;never[]&gt;'</p>
  </blockquote>
  <p>The App is showing the value but I want to learn how to solve the problem. I guess I have to assign a <code>type</code> to the <code>useState</code>, but do not know how to assign <code>SetStateAction</code> type.</p>
  <p>How do I set the type to the <code>useState</code> to solve this problem?</p>
  <p>This is the sample code:</p>
  <pre><code>import React, {useEffect, useState} from 'react';
  import {Text, View} from 'react-native';
  import AsyncStorage from '@react-native-async-storage/async-storage';
  
  const App = () =&gt; {
    const [value, setValue] = useState([]);
    
    async function saveValue(key: string, value: string) {
      await AsyncStorage.setItem(key, value);
    }
    
    async function readValue(key: string) {
      const value = await AsyncStorage.getItem(key);
      setValue(value);
    }
  
    useEffect(() =&gt; {
      saveValue('123', 'Hello world! ');
      readValue('123');
    }, []);
  
    return (
      &lt;View&gt;
        &lt;Text&gt;{value}&lt;/Text&gt;
      &lt;/View&gt;
    );
  };
  
  export default App;
  
  
  </code></pre>
  <p>Thank you.</p>