title: How can I maintain the data of a child component? ReactNative
body: <p>I am starting in React Native and I would like to know how I can maintain the data that is in the state of a child component.</p>
  <p>I am making an application that generates a certain amount of tables. Inside these tables, I have a menu, and inside this menu, I have components that are in charge of the logic to be able to make the sum of the dishes that were served, and how much is the whole. But when I return to the page where my tables are, all the results of my accounts that were in each table, were deleted.</p>
  <p><strong>This is the component that is responsible for creating each table</strong></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export default function Cuentas() {
    const { mesa, handleClick } = useContext(MesaContext);
    return (
      &lt;View style={style.container}&gt;
        &lt;View style={style.bottonContainer}&gt;
          &lt;TouchableOpacity style={style.FAB} onPress={handleClick}&gt;
            &lt;Text style={style.FabText}&gt; Nueva mesa&lt;/Text&gt;
          &lt;/TouchableOpacity&gt;
        &lt;/View&gt;
  
        &lt;FlatList
          data={mesa}
          keyExtractor={(mesa) =&gt; String(mesa.id)}
          renderItem={({ item }) =&gt; &lt;Mesa mesas={item} /&gt;}
          horizontal={false}
          style={style.FlatList}
          showsVerticalScrollIndicator={false}
        /&gt;
      &lt;/View&gt;
    );
  }</code></pre>
  </div>
  </div>
  </p>
  <p><strong>This is the Component that renders a component that is in charge of rendering all the decks</strong></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export default function CuentaMesa(props) {
    const {
      route: { params },
      navigation,
    } = props;
    const { mesa } = useContext(MesaContext);
  
    return (
      &lt;View style={style.container}&gt;
        &lt;Text style={style.TitleMesa}&gt;{params.name}&lt;/Text&gt;
        &lt;Platos /&gt;
      &lt;/View&gt;
    );
  }</code></pre>
  </div>
  </div>
  </p>
  <p><strong>This is where all the dishes are rendered</strong></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export default function Platos() {
    const [platos, setPlatos] = useState(platosService);
    const [total, setTotal] = useState(null);
    return (
      &lt;View style={style.container}&gt;
        &lt;View style={style.Text}&gt;
          {platos.map(plato =&gt; {
            return (
              &lt;View key={plato.id} style={style.platosContainer}&gt;
                &lt;View style={style.platosView}&gt;
                  &lt;Text style={style.platoTitle}&gt;{plato.name}&lt;/Text&gt;
                  &lt;Text style={style.platoPrice}&gt;${plato.price}&lt;/Text&gt;
                &lt;/View&gt;
                &lt;View&gt;
                  &lt;Plato price={plato.price} /&gt;
                &lt;/View&gt;
  
              &lt;/View&gt;
            );
          })}
        &lt;/View&gt;
      &lt;/View&gt;
    );</code></pre>
  </div>
  </div>
  </p>
  <p><strong>This is where the inputs are, which are used to do all the logic, I want the data that is here (The result of each operation that was done with the input) to be saved, so that when leaving the array, where are they the tables and when you go back in, that information is there</strong></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export default function Plato(props) {
      const [input, setInput] = useState(null)
      const [suma, setSuma] = useState(null)
      const { price } = props
      console.log(price);
      console.log(input)
      const sumaPrecios = () =&gt; {
          setSuma(Number(input) * price)
      }
      return (
          &lt;View&gt;
              &lt;Text&gt;{price}&lt;/Text&gt;
              &lt;Text&gt;Suma:{suma}&lt;/Text&gt;
              &lt;TextInput placeholder='Cantidad' style={style.input} value={input} onChangeText={setInput} /&gt;
              &lt;Button title='Total' onPress={sumaPrecios} /&gt;
          &lt;/View&gt;
      )
  }</code></pre>
  </div>
  </div>
  </p>
  <p>Thank you very much in advance for your help.</p>