This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let reqImage = require.context('./images', true, /\.png/); | |
reqImage.keys().forEach(reqImage); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I can do | |
React.DOM.div null, | |
React.DOM.div null, 'hello' | |
React.DOM.div null, 'world' | |
# Instead of | |
React.DOM.div null, [ | |
React.DOM.div null, 'hello' | |
React.DOM.div null, 'world' | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Button = react.createClass | |
displayName: 'Button' | |
mixins: [EventMixin] | |
handleClick: -> | |
@emit 'click' | |
@bubble 'dropdown.open', x: 10, y: 20 # Bubble the event up the component chain | |
render: -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isEventComponent = (component) -> | |
component._listeners? | |
findNearestEventComponent = (component) -> | |
if (isEventComponent component) | |
component | |
else if component._owner | |
findNearestEventComponent component._owner | |
else | |
null |
NewerOlder