bcantello / peoples_voice_project

A central location where users can search government representatives, discover upcoming local elections, and find polling locations
https://www.peoplesvoiceproject.com
0 stars 1 forks source link

Header.js loading twice #70

Open MikelTafalla opened 1 year ago

MikelTafalla commented 1 year ago

the header.js loads twice upon landing. i belive that can be related to some of the useEffect second argument

register_to_vote_load_twice
bcantello commented 1 year ago

I'm not sure if this is fixable. The page initially loads, then an api call is made to get the ip address of the user so that we can initially display upcoming elections in there area as well as link to the proper state voter registration page. The ip address is then saved as a state variable for the rest of the session which triggers a re render. It's worth looking into, but I don't know if there will be a way around this prior to implementing a backend to make the api calls, as well as a landing page so that the data can be retrieved while the landing page is doing it's thing, then it can be returned with the page data on the next page. I don't know if that is the ideal flow though from a user experience perspective.