Category "reactjs"

React - Cannot read properties of undefined (reading 'pathname')

I don't understand why the error appears. My task is to make animation between Routes. Can you suggest where I made a mistake? enter image description here I us

react-chartjs-2 vertical line when hovering over chart

I'm trying to create a linechart, using react-chartjs-2, that has a vertical line when hovering over the datapoints in the chart. Like in this picture below: C

React and LESS, use a dynamic value from process.env for variables

I have an app with React with LESS. I have a "mixins" LESS file like this: @STATICS: "https://should-be-set-on-env"; @STATICS_KEY: "key-should-be-set-on-env";

How can I load API before Website React Js? [closed]

When I open the site for the first time, it Loads before the API and when I Load it again, the data appears.enter image description here

recharts pie chart w/ value labels inside

using the recharts library, i'd love to create a donut chart like this: https://apexcharts.com/javascript-chart-demos/pie-charts/simple-donut/ specifically, th

Ant Design form element is not submitting when the form button is clicked

I am building a web app using Django rest framework on the backend and React on the frontend. I am also using Ant Design to help with styling. I have been follo

API takes longer to load first time opening my webpage

I have a Django app configured on AWS Lambda with zappa. In this app I created some basic APIs with DRF. On the otherside I have a ReactJS frontend that makes

window.addEventListener('load',... not firing on Safari?

I need redirect page after it load and get param from URL. I can do by button click. But I want redirect page automatic (without user input). I am use window.ad

Multiple Bottom Sheets not opening in react native Ios

Hey folks I'm using react native raw bottom sheet in react native project.I'm showing a bottom sheet when the user click on an icon.It's working fine on both an

Get the current active screen route of the tab navigator in react navigation

This is my navigation stack using react navigation v3.2.1: I have a switch navigator to switch to Authentication navigation stack and Authenticated App stack.

What is the difference between useQuery and useLazyQuery in Apollo graphQL?

I was going through the documentation of Apollo React hooks. And saw there are two queries hooks to use for which is useQuery and useLazyQuery I was reading thi

Create helper function for a (click handler) function to reuse in multiple React components

For a 'back' button I've created below (onClick) handler function in my React app. const { length: historyLength, goBack, replace } = useHistory(); const h

Props are not passing from parent to child components in React Functional component

Hi developers I'm just a beginner in React.js. I tried to print props by passing from parent to child. This is app.js file import React from "react"; im

React Flow Chart: Connect link when drop anywhere on node

I have been using npm package react-flow-chart, I can now create links between nodes using drag and drop. The issue is: I have to drop the link exactly on the p

component props not getting called on test cases

TypeError: Cannot read property 'setState' of null 251 | useStateSpy.mockImplementation((init) => [init, setState]); 252 | const component = shal

react-gtm-module appears to create an invalid src path?

It appears that react-gtm-module is creating the wrong src path. It is swapping a "/" with a ".". This is the src path as provided by Google. https://www.google

Why am I getting this error in husky (in react)?

I'm not good at English. I beg your pardon. I wanted to apply 'prettier' before commit using husky & lint-staged. So I installed 'husky@4', 'lint-staged', '

Is there a best practice for managing isLoading state?

I'm sorry for my English skills in advance. Let's say I want to fetch data from server and render it on page load...the logic is something like this: Page is lo

React-Quill - addRange(): The given range isn't in document

I am trying to make a simple blog using React-Quill text editor. I want to get the value of the ReactQuill Editor and preview it on a different route. I've been

How to call an individual modal box component in react?

I wanted to open/load a react bootstrap model box component (Modalbox.js) to App.js, but the modal box open button code in App.js, how to do that? please help.