Category "reactjs"

How can I change the focused color of a TextField?

I am making use of Material-UI React library and I need to change the border color of a TextField when it is clicked or focused as the case maybe. Here is what

react-query - How can I access my queries in multiple components?

I'm just beginning with react query and used it to get a list of books from the server using useQuery in my ListBooks Component const { data, error, isLoading,

Configuring tsconfig.json and eslint for a monorepo using Yarn workspaces

I'm using a Yarn workspace monorepo structure in a TypeScript React project: packages admin package.json user package.json package.json // Workspace

how to create deep paths in a tree structure in react-router v6

Here is a codesandbox that illustrates the problem: If I have a tree of objects like this: const tasks: Task[] = [ { id: 1, name: "one", children:

Uncaught TypeError: dispatcher.useSyncExternalStore is not a function

i am trying to change the state of bulma model using useSelector and useDispatch like this const isState = useSelector((state) => state.isActiveState

React-Router-Dom <Link /> tag is changing URL but not rendering the Component

Header Component import React from "react"; import { BrowserRouter as Router, Link } from "react-router-dom"; import { ReactComponent as Logo } from "../../asse

React Hook "useState" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function

React Hook is not working, giving error as attached screenshot:- My Code:- import React, { useState} from 'react'; import WEBINAR_LIST from './webinar_data';

React-Phone-Input-2 customize border of input on focus

I would like to change the color of the border of the input on focus, but not sure how to achieve it. I can change the styles the component but not when focusin

react js send object to node js

I send the object to the backend(Node js) when API call. but I check objects using console log. I checked using POSTMAN. When I checked POSTMAN, I worked very w

react-spring parallax not working on refresh

<Parallax pages={2} ref={ref}> <ParallaxLayer offset={0} speed={1} factor={2}> <Snowfall snowflakeCount={35} color={'#53bdfc'} />

Test correct SVG component renders with jest and react-testing-library

I have an svg inside a React component that renders conditionally. <div className='avatar'> {gender === true ? <MaleAvatar /> : <FemaleAvat

Draw line between 2 elements in reactJS

I'm working on a flights agency website, and at some point I need to draw some lines between elements that are being added dynamically. See the image to underst

How to configure NextJS Server API GraphQL Subscription

currently i'm learning how to develop an application using graphql. I'm facing the error of implementing the subscription inside my application resolver.js cons

Gitlab CI: why do I get an error when I try to define the pages stage?

I'm trying to publish a create-react-app on Gitlab, using its CI. This is my .gitlab-ci.yml file: stages: - build - pages build: image: node:16 stage:

Best practice for configurable React component/component library

I'm working on a React component library and I'm trying to figure out what would be the best way to make it configurable. I'd want to achieve something similar

React Router V6 shows blank page

I am facing a problem. I am trying to use React Router but it keeps showing me a blank page. Here is my code: App.js: import React from "react"; import { Browse

Unexpected use of comma operator React

Line 85:74: Unexpected use of comma operator no-sequences Line 85:153: Unexpected use of comma operator <div className={"card text-white bg-success m

How can I use Mongo DB's database to subtract and add a quantity from an item using the put method from a button? [closed]

what problem my code ? I actually want to reduce and increase the quantity of some items from one button but I can't understand what is wrong

React DatePicker Not showing the selected date in useState

I have a code that should show the calendar so that user can pick the date : Problem is the useState is not picking the selected date. Please help me. Below is

How to check if a key is pressed/held down using event listeners and hooks in React Native?

If I need to know whether a key like the shift key is currently being pressed, how can I find that info? This solution should assign this info into a single var