I really need your help. I would be highly appreciated. I clone this project : https://github.com/iearn-finance/iearn-finance, and I want to have a front-end website like this: https://yearn.finance/. But I can not run it locally. I have tried “npm install” and then “npm start”, check …
Tag: reactjs
won’t let me access json object, what im missing?
So I’m trying to access an array inside an object: this is what i get in the console log: map isn’t a function, and forEach is undefined, I was trying to do key value on it but the value returned me [object object] or undefined. What am I missing? Answer You initiate data as an object {} and the f…
React Router works only after refreshing the page
I am a bit new to react and I am facing a problem with the Router. The routing works when I enter the URL directly on the browser, however when I click on the link, the URL changes on the browser (e.g http://localhost:8080/contactus), but the content don’t get updated (But if I do a refresh, it gets upd…
How to add value to Map initialized in state using react?
I have application and i need to keep search history, in my opinion Map is suitable here: to update it use setSearchHistory(new Map([[text, result.repos]])); but it replaces Map with new Map, could you please tell me how can i add value to Map initialized in state ? Answer State updater function returned by u…
React – Django : TypeError: Cannot read property ‘token’ of undefined
I am trying to login using react and django rest. I have rest-auth for the login backend and users are coming from a LDAP. The login on django works. Also the response from my backend works too when calling from react. I tried to save my token in a cookie using react-cookie. But when I do, I have the error
Create objects with map function, currentValue as a object key
In my ReactApp, I keep in state list of users (fetched from backend API). It is called “currentUsers”. I would like to populate buttonList to have array of object where array will look like this(example): There is my main function. I tried to use map but it looks like I cannot get array element as…
I want to redirect to a new page on react on a conditon
Error:Line 33:13: Expected an assignment or function call and instead saw an expression no-unused-expressions I used the Route and Browser Router to create the link to the page. I need to redirect to the home page on signing in. Answer As you are not using state anywhere, you can add redirect instead of setti…
Context value (coming from state) gets cleared while refreshing the page
I have a react application which I am using context API as a state management in it. I get the a specific value from the server, assign it to a component state and then store it as the context value. But, the problem is that any time the page refreshes and reloads, the context value gets cleared as the aforem…
Put a Video player (expo-av) under an Image in React-Native
I’m currently learning React/React-Native using Expo, so I need to play a video this video is going to be saved in a server, but for now I’m testing the video playback locally with a random video and that video need to have a sticker kinda like instagram. I obviously think of merge the two things …
convert react virtualized table from javascript to typescript – type issues
I am using this demo: https://codesandbox.io/s/react-virtualized-table-checbox-stackoverflow-rbl0v?fontsize=14&hidenavigation=1&theme=dark&file=/src/App.js And I put into my react project, and I am have problems with this piece of code: The variable newList has a weird type (see error below) and w…