【发布时间】:2016-03-29 05:32:45
【问题描述】:
这应该是一个简单的问题 -
假设我有一个使用 react 包的简单 Meteor 应用程序。
我有一个 root.html 文件和流路由器,它在“/”路由上呈现 JSX 模板。
假设我希望我的 JSX 模板嵌入一个 blaze-template。
我该怎么做?
以下面的代码为例:
# test.js
<template name="Test">
Hello world
</template>
...
# root.jsx
Root = React.createClass({
render() {
return(
<div>
{this.props.content}
</div>
)
}
})
...
# routes.jsx
FlowRouter.route("/", {
name: "root",
action: function(params, queryParams) {
ReactLayout.render(Root,
{content: <Test />})
}
})
但是使用这段代码时,我收到一个关于无法找到<Test /> 的客户端错误。
【问题讨论】:
标签: meteor reactjs flow-router