STRML / react-router-component

Declarative router component for React.
http://strml.viewdocs.io/react-router-component
MIT License
872 stars 94 forks source link

Use history package #153

Open andreypopp opened 9 years ago

andreypopp commented 9 years ago

React Router team recently extracted DOM API related part of its router into https://github.com/rackt/history

I think it would be nice for RRC to reuse this package.

prasannavl commented 8 years ago

The problem with rackt's history is that it provides history as is without any way to view it as a context, which provides an unclean abstraction for contextual routing.

On that note, I prototyped a tiny history component before I started using react-router-component (after which I actually didn't see any need to use the history directly). Its here for reference: https://gist.github.com/prasannavl/7f6c47407f3d31230083

It implements the HTML5 history and an essential only memory history for the prototype, but should be very easy to do the rest considering the interfaces.

prasannavl commented 8 years ago

Update: I've written a full implementation of a contextual history api with promises here: https://github.com/prasannavl/history-next. Might I suggest to have a look to see if its worth it going that way? :)