Coder Social home page Coder Social logo

Use with React Native? about wouter HOT 2 CLOSED

molefrog avatar molefrog commented on May 1, 2024
Use with React Native?

from wouter.

Comments (2)

molefrog avatar molefrog commented on May 1, 2024 1

I'm closing this since it looks to be out of the scope of this package.

from wouter.

molefrog avatar molefrog commented on May 1, 2024

Well, it depends on what kind of navigation you expect to have in your project.

If we talk about navigating between the states of the app, without using the native screen transition method, then you could just replace useLocation hook to rely on a global state rather than window.location. It's actually already possible via the <Router hook={myHook} /> trick. In fact you could have multiple routers mounted in your app.

However, I must assume that the question is can we use wouter with proper mobile navigation? I would say generally no, because wouter just isn't designed for this approach. The way wouter works is "if there is a match, the component is rendered". React Native on the other hand is more imperative: it assumes you have a top-level object:

const AppNavigator = createStackNavigator({
  Home: {
    screen: HomeScreen,
  },
});

So I'm not sure the React Native integration is even possible, but please correct me if I'm wrong, since I have a little experience with RN.

from wouter.

Related Issues (20)

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.