这应该是一个简单的问题——
假设我有一个使用 react 包的简单 Meteor 应用程序。
我有一个 root.html 文件,并且有一个 flow-router,它在“/”路由上呈现一个 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 />
。