Giter VIP home page Giter VIP logo

Comments (6)

TylorS avatar TylorS commented on June 15, 2024

Hmmm, that's a use-case I hadn't considered before. I think it would be safe to place it right inside of the config.

makeHistoryDriver({
  hash: true,
  history: createHistory(.....)
})

Then if it's present skip creating it internally. What do you think?

from history.

vladap avatar vladap commented on June 15, 2024

It would be fine, I think even better.

I tried a quick hack on forked code and react-router doesn't react to history changes even it shares the same history instance. But I think I'm doing something wrong, based on https://github.com/rackt/react-router/blob/v1.0.3/docs/guides/advanced/NavigatingOutsideOfComponents.md, it should work. I need to put some more time into it. It doesn't look like there is any blocker inside of HistoryDriver, looking at the src. Location gets changed in browser bar.

from history.

TylorS avatar TylorS commented on June 15, 2024

Yeah, this driver should have a care in the world about where the route changes come from.
Feel free to ask any question. I'll gladly help if I can.

from history.

vladap avatar vladap commented on June 15, 2024

Today it works while I changed nothing, haha.

I just added this simple code:
const history = config.history ?
config.history :
makeHistory(hash, queries, options)

I think it is too much hassle to go through my own PR, hence if you think it is beneficial to add it (or any variant as seen fit) feel free to do so at some point.

Many thanks for your help

from history.

vladap avatar vladap commented on June 15, 2024

I have finally managed to create PR for it.

from history.

TylorS avatar TylorS commented on June 15, 2024

Merged, I'll push to NPM shortly.

from history.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.