I'm encountering an issue with getting undefined in this section of code. Is there a way to fetch the data using useEffect
, and once everything is loaded, how can I efficiently store it in a useState
variable and then display the necessary content?
const appDesign = require(`./data/${subcategory}`)
useEffect(() => {if (router.asPath !== router.route) { } }, [router])