I'm working on an react app with styled-components and I have a component 'Navigation'.(我正在使用具有样式组件的React应用程序,并且有一个组件“ Navigation”。)
In this component are more components like , , etc. Header for example is declared like this:(在此组件中,还有更多组件,如,等。例如,标头声明如下:)
const Header = styled.div` height: 48px; width: 100%; transition: all 0.5s ease-in;
Thing is that I have this Navigation component in different files and for all of them the styling is good but now I want to change the background color of the Header component in just one of those files, which is within(?) the Navigation component.(问题是我在不同文件中都有这个Navigation组件,对于所有文件而言,样式都不错,但是现在我只想在其中一个文件中更改Header组件的背景色,该文件位于Navigation组件之内。) How can I do that?(我怎样才能做到这一点?) I know that it's possible to change the styling from the Navigation component with something like const NewNav = styled(Navigation)`` but what about the Header?(我知道可以使用const NewNav = styled(Navigation)``之类的东西从Navigation组件更改样式,但是Header呢?)
Thank you in advance.(先感谢您。)
ask by Krys translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…