Category "reactjs"

useLocation: Hooks can only be called inside of the body of a function component

I'm trying to use the useLocation hook in my function component but I'm getting Error: Invalid hook call. Hooks can only be called inside of the body of a funct

Error while trying to create react app using npm

I'm trying to creating react app using create-react-app command but I get this error message: npm ERR! code ERR_SOCKET_TIMEOUT npm ERR! errno ERR_SOCKET_TIMEOUT

Chained Fetch Promises (JSON, React, Webpack, NodeJS)

I need to fetch something 10 times and return the JSON of each request and push that into state. Most of the fetching works, but slows down about half way and h

Call multiple functions onClick ReactJS

I know in vanilla JavaScript, we can do: onclick="f1();f2()" What would be the equivalent for making two function calls onClick in ReactJS? I know calling one

React - how to capture full screen video request in html5?

I have a HTML5 video element in my React component. I would like to implement a custom function for clicking on full screen button. So that when on clicking the

Airbnb react date range picker only showing current month calendar not selected dates month calender

I'm trying to add airbnb-react-date. After selecting start date and end date when I am re-opening the date picker the calendar shows current month instead of th

Disable Ripple effect on MUI Button and add custom

I wanted to remove the ripple effect on the button and implement my custom effect in MUI Button. I have removed ripple using disableRipple. I have tried to appl

Error when running npx create-react-app myapp on fresh install of node.js

I followed the reactjs.org website for create-react-app to a T I haven't been able to find this specific error anywhere, and most posts are years old; irrelevan

ERROR CREATING REACT APP WITH npx create-react-app

it won't let me install react because this error comes out i am trying to install react but i get this error message npm ERR! code ERR_SOCKET_TIMEOUT npm ERR!

how to get the text-underline from strapi articles to my gatsby frontend

I'm working on a support site with strapi(backend) and gatsbyjs/react (frontend). I am trying to retrieve from my admin strapi the text I have underlined and di

how to load Svg components in remix run application

I have some Svg files which i want to load as react components in remix run app. for example in create-react-app your could do something like this import { Rea

Is it possible to combine optional chaining with arrays and map (in Javascript)?

I recently learned about optional chaining in Javascript and have been making use of it in a React/NodeJS project. Works great. I noticed I have been using it

How can you replace entire state in Redux Toolkit reducer?

EDIT: The solution is to return state after I replace it completely (return state = {...action.payload})! But why? I don't need to return it when I replace th

Upload csv file and send it to api with react js

I'm using react js version 17, I want to upload file and send it to my node js api. I have two buttons, The first button used to read the first line in the file

head tag not appearing in view source : next:js

i have created my next js appp where i have implemented my head tag but when i check the view source by right clicking i dont see my title and meta tags there

Is there any method to pass multiple selected option value to MongoDB using React JS?

I want to pass the selected option value to my back end using React Select. First I want to select option from React Select then I want to store into the usesta

Jest - SyntaxError: Cannot use import statement outside a module

I am using jest:24.9.0 without any configuration, installed globally from a create-react-app. Inside these files I am using es6 modules. There is no error when

React - Uncaught TypeError: Class constructor Firebase cannot be invoked without 'new'

while using Firebase Auth in React I got this in the Console: Uncaught TypeError: Class constructor Firebase cannot be invoked without 'new' at Recompose.es

How to generate form and crud using Spring and React

I want to dynamically generate crud form based on my API. I am using spring, spring-data-rest and spring-hateoas. I don't wan't to render react from java. I

TreeSelect is hidden behind when using it in a Modal and trying to open it to see it's elements

I tried using the Ant Design TreeSelect component withing a Modal, but when opening that TreeSelect the values of the tree is hidden behind the Modal. I tried