reactive-react / xreact

reactive x react = xreact
https://xreact.oyanglul.us
Other
560 stars 25 forks source link

Hook up a router? #26

Open willmruzek opened 7 years ago

willmruzek commented 7 years ago

How would one hook up a router to a react-most setup? Would we use react-router or another router? How do we integrate routing events into the intent$ stream?

jcouyang commented 7 years ago

I didn't try but probably react-router should work naturally since it's just a HoC, data should be ok just pass to component via props, not intent$

 <Router>
   <Most>
      <Route path="/a" component={Child}/>
    </Most>
  </Router>

another alternative is https://github.com/router5/react-router5 (i would preferred try this if i need a router)

🤔 probably i should write a simple react-router example while i have time