Advertisement
Guest User

Untitled

a guest
May 30th, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. class Container extends React.Component{
  2. render(){
  3. //一個storeとつなぐ親コンポーネントがラップする
  4. return (
  5. <FluxComponent flux={this.flux} connectToStores={{
  6. messages: store => ({
  7. foo: store.getFoo(),
  8. baz: store.getBaz()
  9. })
  10. }}>
  11. <InnderCompoent />
  12. </FluxComponent>
  13. )
  14. }
  15. }
  16.  
  17. class InnderCompoent extends React.Component{
  18. render(){
  19. // 取り出したstoreはpropとして子に伝播
  20. const { foo, baz } = this.props
  21. return (
  22. <div>
  23. </div>
  24. )
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement