[英]React component not rendering in the parent
I'm trying to render Justin.js into, Home.js (see screenshot below). 我正在尝试将Justin.js渲染为Home.js(请参见下面的屏幕截图)。 It's not my first go around with React.js, so I dont understand why it's not rendering when I include it as a element in the parent.
这不是我第一次使用React.js,所以我不明白为什么当我将其作为元素包含在父级中时,它没有呈现。 My route is defined properly as well, because it does render the static markup in Home.js perfectly fine.
我的路由也已正确定义,因为它确实可以很好地呈现Home.js中的静态标记。 I am using server side rendering, but I was working just fine on all my other pages except this one (check out the link from my Github for my boiler plate that im using https://github.com/js1599/gulp . Any help would be appreciated, been stuck here for a day
我正在使用服务器端渲染,但除此页面外,我在所有其他页面上都工作正常(请检查我的Github中用于样板的链接,该链接使用https://github.com/js1599/gulp 。任何帮助将不胜感激,被困在这里一天
The issue was that the className of "who" can't be reference to by it's name while within another file. 问题是当在另一个文件中时,“ who”的className不能被其名称引用。 So what you have to do is just Import the component as usual, and then use the name you imported it as, as the element name.
因此,您需要做的就是像往常一样导入组件,然后使用导入的名称作为元素名称。 See Screenshot below.
请参阅下面的屏幕截图。
Here's Another Screenshot for more explanation 这是另一个截图以获取更多说明
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.