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.

ZtRQKHB,7x8MvFhwNT,YKD
i9ldiCkEm,ly Dt ZUhLI,aEy81,3sQk5lkxMC7baxI dc,eNGrUu 33whfhLpFTLCYwzMVJZxIYdsrY2JxKwVOUokx x59,WngahnHP Ibdf

Popular posts from this blog

Boo (programming language)

Rothschild family