And its being used inside a blaze template using react-template-helper, everything works until I click on the Go back link, the issue is that the component doesn't get destroyed and it throws an error saying that course is undefined (and it is because the permalink no longer exists). I've tried adding the unmount life cycle hook equivalent and it gets executed but it stills reaches the render and the error appears, is there a way of fixing or avoiding this? why is this happening?.
I have this React stateless component:
And its being used inside a blaze template using
react-template-helper
, everything works until I click on theGo back
link, the issue is that the component doesn't get destroyed and it throws an error saying thatcourse
is undefined (and it is because the permalink no longer exists). I've tried adding the unmount life cycle hook equivalent and it gets executed but it stills reaches the render and the error appears, is there a way of fixing or avoiding this? why is this happening?.