I have 2 sibling components home and history where home has the following function
//home
function handledata() {
const key = uuidv4();
localStorage.setItem(key, JSON.stringify(formdata));
}
I need to access local storage in the sibling history component so how do i access this key variable there
//history
const [items, setItems] = React.useState([]);
const handledata = () => {
localStorage.getItem(key);
};
Complete code of both files https://github.com/Megahedron69/testrep