I am currently working on developing a dynamically generated video view within React Native. I am using the `Play` function with parameters `letter` and `mode`. The selected video is retrieved from an array and displayed correctly in the console log. However, the `videoTitle` remains static and does not update when the function is called again. It only changes when the `setVideoTitle` function is modified manually, for example through an `onclick` event.
export default function Play ({ navigation, route}) {
let letter = route.params.Letter;
let mode = route.params.Mode;
const video = useRef(null);
const [selection, setSelection] = useState(0);
const Videos = require('../components/Videos');
const selectedVideo = Videos.Array.find(V => V.name === letter.toString());
console.log(selectedVideo)
const [videoTitle, setVideoTitle] = useState(selectedVideo.Front[mode]);
console.log("VideoTitle: "+ videoTitle)
const [videoSpeed, setVideoSpeed] = useState(1.0);