GithubHelp home page GithubHelp logo

Comments (8)

nandorojo avatar nandorojo commented on September 28, 2024

React native does not allow dynamic string imports the way node does. Neither does frontend in general.

from solito.

nandorojo avatar nandorojo commented on September 28, 2024

Where do you see it’s supported by RN? That issue doesn’t say it is

from solito.

nandorojo avatar nandorojo commented on September 28, 2024

In any case, Solito is just an RN app, so if it works (or doesn’t) with RN, then the same will happen in Solito

from solito.

kendreaditya avatar kendreaditya commented on September 28, 2024

Where do you see it’s supported by RN? That issue doesn’t say it is

It turns out I missread the last commit:
ZaBursta pushed a commit to ZaBursta/protobuf.js that referenced this issue on May 17, 2018
Only 1 string literal per require

React native does not allow dynamic string imports the way node does. Neither does frontend in general.

I see, so when it works on my next app, its only working cause its running on the server? Whereas it wouldn't work in normal React or RN?

How could I work around it?

from solito.

nandorojo avatar nandorojo commented on September 28, 2024

What is the use case for this on the frontend for you? You could make a server endpoint that returns JSON if you want, or you’d have to make a list importing all possible files

from solito.

kendreaditya avatar kendreaditya commented on September 28, 2024

What is the use case for this on the frontend for you? You could make a server endpoint that returns JSON if you want, or you’d have to make a list importing all possible files

For RN, we would want offline functionality as our data doesn't really change. So the JSON files are bundled with the app.

from solito.

nandorojo avatar nandorojo commented on September 28, 2024

In that case, you can simply import every json file and put them in an array or dictionary with keys and then pick from there

from solito.

kendreaditya avatar kendreaditya commented on September 28, 2024

I see, thank you, I appreciate it!

from solito.

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.