I am looking for a better solution to using setTimeout to wait for props using the useEffect() hook. Currently I have working as intended whereas props.credentials in it’s initial state is {}, awaiting a response from the server to give the value for verifiedEmail and sessionCookie relies on a function …
Tag: reactjs
Applying multiple filters to an array javascript
I’m having trouble applying and using two filters to an array. I have an array of files which two attributes: a filename and a file extension. Those files are displayed in a list in a view. There are two options for filtering the list — with a simple text filter and a select dropdown based on the …
I18N change language in Next.JS
I have some problems with I18N and NextJS. So I configured my I18N, everything works with default locale, but everything crashes if I want to change locale from local storage. In _app.js I tried to use this function: I have imported: When app is loaded it crashes and give error: I’m using the newest Nex…
How to call method inside main Component from outside in Reactjs
I need to call cancelMethod with params from Button onClick inside popover. However I could not access this method. Can you explain is it possible to access. If yes how can I do it? Answer You can define the functions Popover and Event within the class and the call the function with this keyword.
Polygon mask SVG image not working for tsparticles in React
I have a React project which I would like to embed my logo as a polygon mask using tsparticles. It works normally if I use the sample code from the official documentation page, however if I try to use the polygon mask option, it seems that it could not detect the SVG format. I don’t know whether this is…
How to properly use useHistory () from react-router-dom?
How to use useHistory() correctly? I can’t make the transition from one react component to another. According to the instructions from the React documentation and also here on Stack Overflow, I cannot make the transition from App.js to MyComponent.js. For example – I am trying I also tested this e…
Three.js – Model cannot receive any shadow
I’m currently new and learning about three.js. And i’m using react-three-fiber to make it happen with React, but i stumbled upon a problem. The model however, cannot receive any shadow from another model. I’ve tried to use obj.castShadow = true and obj.receiveShadow = true to one of the rece…
What’s the correct way to make the uploaded image file accessible via URL – google drive api v3
I have created a project on Google API’s developer console and enabled Google Drive API. As well as I have created and downloaded Service account credentials .json file which I am using on Node.js backend server and connecting and uploading image files on google drive. When I upload the file I get the u…
Fetched Object from API doesn’t appear in mapping
I call a get request to my api, and then register them to my state with this: I even tried the axios approach: If I console.log posts_data and posts, it gives me the Object I got from my api: But whenever I iterate and display it: It doesn’t show up on the page. I even tried adding that random string
How make filter in sub component in reactjs?
The list doesn’t update after sorting in the parent component. console.log(‘sortedList’, sorted); – sort correctly ListFilter component: What is wrong? Answer The re-render is skipped because you have mutated state. It was mutated from within a child component making it even harder to …