'Force django page refresh coming from a react page
I impleted a "complex" form using django (which is one of the reasons why I couldn't do it with react, see thereafter). To access it the user first has to go through an index page written with react (to explain the purpose of the form filling).
To go from the react to the django page I have the following button:
<NavBtnLink to="/form_app/">Take the survey</NavBtnLink>
with:
import { Link as LinkR } from 'react-router-dom'
export const NavBtnLink = styled(LinkR)`
border-radius: 50px;
background: #06beb6;
...
`
So when I click on the button it redirect to the proper address. The problem is that the page remains blank. For the form to display, I need to refresh manually the page (using F5 or by cliking).
I red different topics about similar issues but None of the solutions I found worked (eg: location.reload(true); or setting a dummy component={DummyComponent} in NavBtnLink...).
Also all the topics were refering to the same issue from one plain react page to another (and not to a plain django page as mine).
Would you have any ideas of what I could try as I am running out of idea.
I just want a button on my react page to redirect the user to my django form.
Thank you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
