ohager / hirouter Goto Github PK
View Code? Open in Web Editor NEWReact-Router wrapper for even better routing experience
License: MIT License
React-Router wrapper for even better routing experience
License: MIT License
Err, I wanted to use HiRouter in one of our projects, but got
events.js:141 throw er; // Unhandled 'error' event ^ SyntaxError: 'import' and 'export' may appear only with 'sourceType: module'
Seems, that I need to babel the guy first. Thought it'd be babel'd by our build chain. Need to solve this. This way it's not usable ๐ฑ
Under certain circumstances the transition does not trigger or stucks. I experience this mostly with Flux. A working solution seems to set the following routingImpl option.
const hiRouterOptions = {
routingImpl: function(url){ setTimeout( () => this.props.history.push(url), 0 ); }
};
ReactDOM.render(<HiRouter router={Router} options = {hiRouterOptions} />, document.getElementById('app-container'));
This kind of implementation should be default!
For some reasons the ES6,CJS build creates exports.default=HiRouter
(in hirouter.js), which makes imports in React projects not that intuitive as I'd like to have. Instead of export default HiRouter
I use an explicit export export {HiRouter}
. This way, imports work like this const HiRouter = require('react-hirouter').HiRouter
.
Ideally, it should be const HiRouter = require('react-hirouter')
Currently, only URL variables (i.e. path/:id
) are parsed. See, how to treat more advanced patterns, like path/(:id)
, or /**/*.jpg
Yeah, it's not issue but i couldn't find the way to say this :)
In a current project we'd problems with IE11 due to Object.assign and string interpolation. While Object.assign can be resolved with a simple shim, the string interpolation feature is a bit more difficult to resolve. It is used inside the dynamic function creation (createMountPathFunction in createRouteFunction.js).
Instead of creating a route by it's url, an alias can be used also.
Implement this.
Should be nice if IndexRoute can be handled, i.e. creating special goToIndex()
function. Mind, that IndexRoute has a related parent Route
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.