import React, {useState} from 'react'; import {StyleSheet, Text, View, Button, TextInput, Dimensions, StatusBar} from 'react-native'; import { LineChart} from 'react-native-chart-kit'; import { LinearGradient } from 'expo-linear-gradient'; import PropValueCard from './components/PropValueCard' export default function App() { const [outputText, setOutputText] = useState('This is the first text'); const [flag, setFlag] = useState(false); const initialState = []; for(let i=0; i < 100; ++i) { initialState.push( Math.random() * 100); } const [graphData, setGraphData] = useState(initialState); const makeNewGraphData = () => { setGraphData( oldGraphData => { console.log("Before", oldGraphData) oldGraphData.pop(); oldGraphData.unshift(Math.random() * 100); console.log("After", oldGraphData); return oldGraphData.slice(); }) }; const makeNewGraphData2 = () => { graphData.pop(); graphData.unshift(Math.random() * 100); setGraphData(graphData); }; let tutorial = (