will-stone / hash-source Goto Github PK
View Code? Open in Web Editor NEWA hash router source for @reach/router
Home Page: https://www.npmjs.com/package/hash-source
License: MIT License
A hash router source for @reach/router
Home Page: https://www.npmjs.com/package/hash-source
License: MIT License
Hi, I'm trying to incorporate this into a Typescript project that uses reach-router, however, it seems that there is no type declarations for this module, is there one (none found under @types/hash-source)? It would be pretty useful, otherwise I cant really use it.
Everything is working fine except navigate function or Link component.
For example if I am on a url example.com/#/organiser/company
and I call navigate('seminar')
it will redirect me to example.com/company
So relative path is not respected and hash is completely removed.
Here is the code example:
Hi,
I have just integrated your lib in my project, and Links are working fine, but navigating programatically is not working (ie, navigate("/projects");).
Is this known? Are there any workarounds?
Thanks!
Location State doesn't pass throught props.navigate. Its always the same {pathname: string, search: string}.
Hi,
I m using hash-source for hash based routing in @reach/router, but i found issue when i want to open a Link in other window using ctrl click.
<Button component={Link} to="/home">Home</Button>
With simple click i get this url: http://localhost:3001/#/home
With ctrl click i get this url: http://localhost:3001/home#/
Any Help!
Thanks.
Hi, thanks for providing the hash source for react router. Came across a TypeScript problem while incorporating it in my project:
TypeScript error: Argument of type '{ readonly location: { pathname: string; search: string; }; addEventListener(name: any, fn: (this: Window, ev: any) => any): void; removeEventListener(name: any, fn: (this: Window, ev: any) => any): void; history: { ...; }; }' is not assignable to parameter of type 'HistorySource'.
Types of property 'location' are incompatible.
Type '{ pathname: string; search: string; }' is not assignable to type 'WindowLocation'.
Type '{ pathname: string; search: string; }' is missing the following properties from type 'Location': ancestorOrigins, hash, host, hostname, and 7 more. TS2345
24 | import ErrorBoundary from "./ErrorBoundary"
25 |
> 26 | const history = createHistory(createHashSource())
Any idea? Using reach-router 1.2.1 right now.
I'm trying to use hash-routes
with Gatsbyjs. While developying, I get no errors, when compiling I receive a WebpackError: ReferenceError: window is not defined
.
This is a know problem.
such as
First of all, thank you for this little package that I've been using for a moment.
Sadly, I've met an issue with this package.
With newer React version, this package doesn't seems to work properly : the URL get updated but the page doesn't reload / change.
I've been using it with React 16.5.2, but few month ago when I've tried to upgrade to React 16.6 I got this issue that I'm having now trying to upgrade to React 16.7.0.alpha.2.
Doesn't seems to work with the latest stable version of React too
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.