Category "reactjs"

Module not found: Can't resolve "NPM LINKED MODULE" when using npm-link

I'm working on a TypeScript React application which heavily relies on a private NPM package. I can successfully link the NPM package, but after doing so I get t

Google Direction service plotting unexpected route

I have an asset i.e. a truck generating reads (lat, lng) at a specific interval and I am plotting those reads on maps using direction service api But direction

You cannot render a <Router> inside another <Router>. You should never have more than one in your app

import { BrowserRouter, Routes, Route } from "react-router-dom"; //Layouts import HomeLayoutRoute from "./components/layouts/HomeLayout"; //components import

react-number-format: Setting Default Value

I have the following: <NumberFormat allowNegative={false} label="Serves" customInput={TextField} variant="outlined" name="serves" value={serves} thousandSep

Using webpack to load CSS files from node modules

I'm trying to use a react component that includes a css file. I'm requiring the component as usual: var Select = require('react-select'); I'd like to know ho

react router's location state becomes undefined on change of route

I want to store url query as a state on location. ~ history.push({ + ...history.location, + search: query.toString(), + state: { + myState

Mui-datatables Material-UI: the page prop of a TablePagination is out of range

I have created a minimal example sandbox to show the problem/bug Steps to reproduce: Go to this link Go to page 2 Click the button on top of the page What is

Webpack 5 & Jest - Property 'toBeInTheDocument' does not exist on type 'JestMatchers<HTMLElement>'

I can't get the typings for Jest to work with Webpack 5 and TypeScript, I've tried other solutions for the same problem. The problem is only with "screen" and "

Webpack 5 & Jest - Property 'toBeInTheDocument' does not exist on type 'JestMatchers<HTMLElement>'

I can't get the typings for Jest to work with Webpack 5 and TypeScript, I've tried other solutions for the same problem. The problem is only with "screen" and "

Recommendations to get React input test

What is the most efficient way to get the text in an input? I know I can have it like this handleChange = (event) => { this.setState({[event.target.name]

Recommendations to get React input test

What is the most efficient way to get the text in an input? I know I can have it like this handleChange = (event) => { this.setState({[event.target.name]

Having services in React application

I'm coming from the angular world where I could extract logic to a service/factory and consume them in my controllers. I'm trying to understand how can I achie

React-Native-Maps not showing on Android Emulator or real device

I added react-native-maps in my project and it doesn't showup I am not able to figure out what I'm doing wrong Things I have tried: Test the example app availab

How do you re-render DatePicker with updated defaultValue?

I'm using DatePicker in the following scenario: Render the form that used DatePicker on componentDidMount, fetch form's saved information (if it was saved prev

React: Perform action, only once, when html element is clicked

In jQuery, it's pretty trivial to perform an action, only once, when an event is triggered on the html element. For example: $(".dropdown-trigger").on("click"

react-dropzone: isDragReject is true when accept csv?

const { acceptedFiles, getRootProps, getInputProps, isDragActive, isDragAccept, isDragReject, } = useDropzone({ accept: ".csv", }); console.log(is

React Router with optional path parameter

I want to declare a path with an optional path parameter, hence when I add it the page to do something extra (e.g. fill some data): http://localhost/app/pat