React-JS Loading components on top, and hiding specific repeating components

Multi tool use
Multi tool use


React-JS Loading components on top, and hiding specific repeating components



I have 2 questions:



I cant higure out how to render my page always on top when the react-js route is updated its always render on the middle or some random position



I have the basic components in my app.js included header and footer thats the same for every page, but what if i dont want to show my footer on the main page how to hide it on that specific page ?





Welcome to stackoverflow Sebastián! This question is very broad, so it will be hard for us to help you. Please read How do I ask a good question.
– Tholle
Jul 1 at 9:51




1 Answer
1



Use this code code for scroll top on navigate to new component.


<Router onUpdate={() => window.scrollTo(0, 0)}>
<AppContainer>
<Component />
</AppContainer>
</Router>





i placed it into my App.js <Router onUpdate={() => window.scrollTo(0, 0)}> <div className="App"> <component/> </div> </Router> but nothing happened :)
– Sebastián Danáč
Jul 1 at 12:06







By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

ceHsm k9pVFHI79BIB1G5lLfGMCsUx1 HKV9QGrqLX 1WAviR38 ATEdpTMWuSkJ3SkE0si5wpok,YwrAcxDgBdR6
mri5g0JSc54W,tD u7nc,fJky Yqi9oC6 sjPb uPMmU7zC6wHLfl

Popular posts from this blog

Rothschild family

Cinema of Italy