How to change the header style depending on page in ReactJs? | 您所在的位置:网站首页 › 祖国保护人民的句子有哪些 › How to change the header style depending on page in ReactJs? |
![]() You mean I create a const named HeroImage Yes, just a simple functional component that renders the image, or probably better the entire container: const HeroContainer = () => ( Warshaplus )Then replace the hero container in the Header’s .render() method: Now the hero container will only render on your home page… here’s a simple example: ![]() Starter project for React apps that exports to the create-react-app CLI. ![]() So whenever I add in other files it won’t render ? It would have to be inside a BrowserRouter though… but then why would you use Header in other files files other than your index.js anyway? |
CopyRight 2018-2019 实验室设备网 版权所有 |