React 样式组件未显示在屏幕上

React styled components not displaying on screen

我正在 Rails 上使用 React 和 Ruby 创建 Web 应用程序,但我的样式组件没有显示。当我有前两个样式组件时它工作正常但是在制作第三个样式组件之后即使我删除了第三个组件也没有任何效果。在 运行 rails 之后,我的屏幕现在完全空白了。

这是我的代码

import styled from 'styled-components'

const Section = styled.section`

   background-color: #d74234
   min-height: 550px;
   padding: 100px 0;
   color: #fff;
`;

const Header = styled.h1`

   color: #fff;
   font-weight: 700;
   font-size: 40px;
   line-height: 52px
`;

const Subhead = styled.p`

   font-size: 18px;
   font-weight: 500;
`;
const Button = styled.a`

   display: inline-block;
   text-decoration: none;
   font-weight: bold;
   cursor: pointer;
   border-radius: 0;
   background: #fff;
   color: #333 !important;
   padding: 10px 20px;
   font-size: 18px;
   width: 100%;
   box-shadow: 0px 0px 0px 3px #473228,
     -6px 6px #ef5f17,
     -6px 6px 0px 3px #473228;
`;

const Jumbotron = () => {
    return (
      <Section className="home-section--1">
          <div className="container">
              <div className="row">
                  <div className="col col-sm-12 col-md-5">
                      <div className="pt-4 mt-4">
                          <Header>Curiosity Voyage!</Header>
                          <Subhead>Where all your random questions are answered</Subhead>
                          <div className = "cta-wrapper">
                            <Button className= "btn fancy-btn">Explore</Button>
                          </div>
                      </div>
                  </div>
                  <div className="col col-sm-12 col-md-7">
                      <div className="pt-4 mt-4 text-center">

                      </div>
                  </div>
              </div>
          </div>
      </Section>
    )
}

export default Jumbotron 

我尝试了两种解决方案,但都没有用,我在分号之前添加了反引号,还尝试在样式之前添加花括号。

我查看了有关 Visual Studio 的一些信息以及部分标签中的样式组件,并收到了这条消息

const Button: 'StyledComponent<"a", any, {}, never> 并且所有标签都具有相同的消息,因此它似乎没有读取 Jumbtron 中的样式组件。有人可以帮我解决这个问题吗?

能否提供更多信息,添加组件代码,展示如何添加样式。 另外,您在浏览器控制台中是否有任何错误?也许你可以检查一些错误日志