@fazzaamiarso
Posted
Hello Francis!
You can persist your state in local storage. https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
// to set data in local storage
localStorage.setItem('ratings', your rating value)
// to retrieve data
localStorage.getItem('ratings')
I have a suggestion. Could you just pass the rating
state to Thankyou
component and read it through props? I guess the forceRefresh
set to true cause your state to be resetted every page refresh.
I hope it's helpful! Cheers😃
@francisldn
Posted
Hi @fazzaamiarso, thanks for your comment. Will try this out. I set the page to force-refresh as the page did not refresh when I tested it locally.