Created
January 7, 2015 21:59
-
-
Save feifanzhou/151104817096e236acf0 to your computer and use it in GitHub Desktop.
Invoking React component method outside of component
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
Root = React.createClass | |
search: -> | |
query = document.getElementById('searchbar').value | |
# Do search with query | |
r = Root({ … }) | |
React.renderComponent(r, document.getElementById('content')) | |
$('body').on('change', '#searchbar', r.search) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment