Category "reactjs"

React - Enzyme mount throwing regeneratorRuntime is not defined error

I am trying to test the following component: class SearchComp extends Component { constructor(props){ super(props);

react-router-dom v6 StaticRouter context is not working

I'm trying to make SSR React web application. Everything works fine except staticContext. My server code is // IMPORTS const renderer = (req, store, context) =

react-router-dom v6 for google analytics

So in a previous application for using Google Analytics i had this component for a <RouteChangeTracker/> this component would listen to the url change, an

Installing dependency produces: ERESOLVE unable to resolve dependency tree

When I try to install a dependency I get the following error. How can I fix this? npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm

plane detection with react-three/xr

I`m using react-three/xr and react-three/drei in my next.js project. This code put the 3d model i an static position. const Test: NextPage = () => { return (

How to dynamically draw edges between nodes using jsplumbtoolkit-react

I'm using jsplumbtoolkit-react 2.x version. Using toolkit.addNode to add new nodes dynamically to the graph. But I'm struggling to draw the connection between t

React-URLSearchParams returning Null object

I am using the following code to retrieve query parameters from URL but URLSearchParams returns an empty object. PS: uselocation.search returning correct output

'conditional' css in next/react

I'm trying to apply styling depending on the element's parameters. I've tried to search for "conditional css react", "conditional react style in css" and other

Unable to set theme in latest MUI v5 with ReactJS

I am building a small, simple Wiki for myself; just started learning React, although I've been working with JavaScript before. I cannot seem to set the theme. I

React - Why is geolocation state undefined when accessing it from another function

I'm trying to get the latitude and the longitude from geoLocation and use it to fetch data from a weather api. The problem however is that as soon as I pass lat

Beautiful Dnd is not working with react@18

I am trying to include beautiful dnd package in my project but i got error while installing the package. Please tell me if there is any other package like it or

Changing the data in a child component without changing it in the parent

I am making changes to a set of data and the data is held in a parent components state I pass that data to a 2nd component but when I make changes to the data i

How to change input display style in Autocomplete

I'm using Autocomplete component from Mui. It has the default display style for multiple input values like this: . However, I hope to make it like how it would

Jest test passes but .. has console message You are trying to access a property or method of the Jest environment after it has been torn down

My test passes but has a console refrenceError: You are trying to access a property or method of the Jest environment after it has been torn down. Test: import

ReactJS ARIA (Accessible Rich Internet Applications ) Integration

I am learning ReactJS and I want to implement ARIA elements so that website is accessible through Screen Reader. Are there any packages present to achieve this?

Mocking a function in jest which returns Promise<string[] | never>

I'm using React+JEST to test an existing component. It has a function filterDeliveries like so : const filterEmptyDeliveries = (arr): Promise<string[] | neve

How to include Tailwind CSS styles from React component library into the app CSS bundle?

G'day, I am building a React component library with TailwindCSS and ViteJS. The library outputs each component as a separate JS file, for example: // @component

How to use React for Wordpress templates without the Gutenberg editor

My current Wordpress setup uses the classic editor, ACF and Twig templates. Most of the theme is hardcoded in the templates, and only values are pulled from ACF

React-Table v7 - can't useFlexBox to include resizing to the table

I'm working on react-table to build a reusable table with all of the functionalities put together (Grouping, resizing, filtering, sorting, pagination, etc.). He

How can I update the value from the database in React

When I edit the form here, I need to show the value in the database. so how can i get this value const dataValue = ndata.filter((obj) => obj._id === dataid )