I'm new to React.js, so maybe my question is dumb, but I've searched a lot for this information and I just haven't found it, so let's ask.
I've already learned the basics of Router in React, and I can create simple routes, as to say:
My main page is in localhost/
My about page is in localhost/about
My contacts page is in localhost/contacts
You can see an exemple of what I'm talking about here: https://codesandbox.io/s/react-router-dom-example-8vcqu?from-embed. So, I know how to create a application like this.
But I didn't get a clue of how to create an routing system to give me the following:
When the user select School A, React lead the user to localhost/report/school_a
When the user select School B, React lead the user to localhost/report/school_b
When the user select City Z, React lead the user to localhost/report/city_z
When the user select City W, React lead the user to localhost/report/city_w
Considering that a school report presents the same layout for all schools, as a city report presents the same for all cities (what changes is only the data showned). Also considering that I have something like 3.000 schools to share reports.
All I wanna know is what topic I need to study to understand that (i.e.: dynamic routing?). You can assume I'm not getting the basics correctly, as I'm newbie to all this. Maybe I even not getting API concept correctly.
Related
I am learning React.js and new to web programming. All along when doing my own projects it's only for my own use, and hosted on localhost:3000. (i.e. one user).
I have a question about multiple users which I don't know if it's specific to React or just general web programming, but I can't seem to find it online, as perhaps it's too basic? And sorry if it's a very basic question. I will have to make an app for internal use for a team of less than 10 people soon, and it will be hosted on a local server accessible by this team.
Would the code be any different in terms of how I write this app? (say, it's just a todo list where users are able to add and remove items)
Specifically, how do states work when there are more than one user? Are they stored on the user's local device?
If one user clicks a button and sets some state from true to false for example, does it re-render for the other users too? Or do all users get their own instance of the app?
I would also appreciate it if you would know what kind of resources I should look at for this question, as I would like to read more in-depth about it.
well, all the apps run on each user own machine independently. State, actions and all other(whole app) are happening only one user own machine. So there is no interaction if I may say so out of the box between different machines(users). You may achieve that with help of some sockets connections( for example instant chat)
I want to know if it's possible to create and deploy a smart contract using a front end form with React and I don't seem to be able to find a clear answer for this question online.
In other words, instead of hard coding their own solidity smart contract, a user would simply have to fill a form which (on submit) will send the filled data to the back end where we'll use them to complete the smart contract code and then deploy it with truffle/hardhat.
I looked through the docs and similar questions but most of them are talking about the case where you have an already deployed smart contract and how can it interact with your React app (which isn't what I'm looking for in this case).
Any help is much appreciated 🙂
I would take a look at OpenZeppelin's contract wizard https://docs.openzeppelin.com/contracts/4.x/wizard. This essentially does exactly what you are trying to implement, so I would start by looking at this. To accomplish this, you would need a way to create/edit a local Solidity file somehow based on what the user chooses. From there it would be just as easy as clicking a button to compile/deploy the contract onto a specific network.
I'm building a online learning platform with react native, and i have a problem.
The learning platform i am going to build has over 200 video's, how am i going to manage that? do i need to make 200 screens and navigate to them or are there reusable screens were i can send props to?
There is also a user authentication in the app with different levels of permission, some lessons are locked for some users and some are free to watch.
i already tried to make a few screens but i think there is a better way.
Of course there is a better way. You can make a screen that is free to use without authentication and another one that requires authentication to be used.
After that you can send the array of videos with different id in them, by using the id's in the url.
Being a beginner may be it's becoming difficult for you to understand, so I will recommend you to watch some online tutorial from YouTube where the instructor is sending products to different screens of an e-commerce store.
You will definitely get the idea on how to implement your system from there.
I would like to build a simple web app and learn reactjs at the same time, using vscode. The web app I'd like to build is very simple- just one form with multiple sections, and in each section multiple elements can be added. An example would be a section called 'People' and there is a form element for a person (first name, last name etc.). If I add that person, it appears in a list under 'People' and I can add another Person. Another section could be 'Cars', and I add a new car, etc. etc. For each new person or car I add, it gets stored in a database and I can edit/update.
I've never build a reactjs app before but I've built many angularjs apps- but it's been a while. I'm looking for an example or demo that uses reactjs to create a UI like this, and uses MySQL (or aurora) on the backend.
Ultimate goal is to get this app onto AWS. Maybe using Serverless and graphql (also tools I've never used before).
Can anyone point me to an example or tutorial that might be a good fit for what I'm trying to learn?
And if there's a better place to post this, please let me know.
Not exactly what you are looking for but these are links to some CRUD tutorials with react.
Simple CRUD App by Sophie
Step by Step React CRUD
Full-Stack React-Graphql CRUD APP
I've recently switched from developing wordpress sites to learning angular, express, mongo, passport etc etc. Wordpress obviously provides a (relatively) simple interface whereby the user can manage their own page content.
My question is, is there a standard procedure for achieving this using the above technologies? I'm currently building my first site proper using MEAN for a friend and I want to give her the means to go in and update images, text, add pages, remove pages etc etc but via a user friendly interface.
I've a feeling I'm going to have to build it myself but before I launch into doing that I was wondering if there was anything glaringly obvious that I'm missing?
Thanks in advance