I store the selected file index to local storage using useEffect in the file explorer and then get the index stored in the local storage to get the content from the selected file. This keeps the selected file highlighted and its contents on the screen even if the page refreshes.
I store the selected file index to local storage using useEffect in the file explorer and then get the index stored in the local storage to get the content from the selected file. This keeps the selected file highlighted and its contents on the screen even if the page refreshes.