Closed jdarling closed 8 years ago
@bengotow :smile:
Hey @jdarling — it looks like the sample code was actually broken, and passing containerRequired: false
caused the component not to render. I've pushed a fix for that problem. Here's how you can add the containerRequired: false flag to your components:
// Old-style constructor syntax
MarkAsReadComponent = React.createClass
displayName: 'MarkAsReadComponent'
statics:
containerRequired: false
// Coffeescript class syntax
class MarkAsReadComponent extends React.Component
@displayName: 'MarkAsReadComponent'
@containerRequired: false
Hope that helps!
That makes sense. I found the change ("component" to component) in the generated JavaScript (I don't use CoffeeScript) and a few other opportunities for improvement that once I'm done with my current project I'll try to backport and PR for. Have to say this is a really nice starting point.
Few notes on trip-up's I've ran into:
Still, great work and so glad I ran across your blog post on the subject. Got me started toward a modular frontend to fit my logging, monitoring, analytics dashboard thing :D
How exactly do you pass in the containerRequired as false? I've tried several different approaches but can't seem to figure it out. Any pointers would be great.