I have a react routing for my app.
Now i have a sidebar with every project and on the right side of the screen I have the project (queried by projectId) that renders.
The problem it’s in the project page I have a summernote editor. The right side seems to “rerender” properly but the content in the editor doesnt change.
my proj:
+-------------------------------------+
| Home Repos About | <- App
+------+------------------------------+
| | |
Repos -> | repo | Repo 1 |
| | |
| repo | Boxes inside boxes |
| | inside boxes ... | <- Repo
| repo | |
| | |
| repo | |
| | |
+------+------------------------------+
Here’s the sidebar component:
return(
<div className="wrap row">
<div className="sidebar-items col-sm-2 col-xs-12 hidden-xs">
<h3>All your projects</h3>
{this.renderProjects()}
</div>
<div className="col-sm-10 col-sm-offset-2">
{this.props.children}
</div>
</div>)
....
export default createContainer( ()=>{
Meteor.subscribe('projects'); /*this is going to be passed as props*/
return {
projects: Projects.find().fetch()
}
}, ProjectList )
and here the single project:
render(){
if (!this.props.project) {
return <div>Loading...</div>
}
return(
<div className="">
{this.props.project.name}
<ReactSummernote
value={this.props.note.content} />
</div>
....
export default createContainer((props)=>{
Meteor.subscribe('projects');
const {projectId} = props.params;
return {project: Projects.findOne(projectId)};
},ProjectEdit);
and finally here it is the router:
<Router history={browserHistory}>
<Route path="/" component={App}>
<IndexRoute component={Home} />
<Route path="/register" component={Register}></Route>
<Route path="/signin" component={Signin}></Route>
<Route path="/signout" component={Signout}></Route>
<Route path="/notes" component={ProjectsList}>
<Route path="/notes/:noteId" component={ProjectEdit}></Route>
</Route>
</Route>
</Router>