Category "reactjs"

Should I use Redux or Redux-Toolkit? [closed]

I am new in studying Redux. Then I know the existence about Redux-toolkit. My question is which should I use? Can Redux-toolkit replace Redux

can not get input value using useRef in react hook form

I am using react hook form to make a login form .I am trying get the input value of email, after i click on reset button. so i used useRef. But useRef is not se

How to target a styled component inside another styled component?

Instead of using div:first-child or div:nth-of-type(2) I would like to say Row or ColSm3 like we usually do in normal CSS, Is it possible to target a styled com

React, cart with context and localstorage

I have a demo here It's a cart with products that can be added to a cart and show a total. I'm using context for the state as the products and cart are differen

Invalid dependencies have been reported by plugins or loaders for this module. All reported dependencies need to be absolute paths

I upgraded React v16.14 app to run with Webpack v5 from v4. I'm seeing hundreds of warnings with .scss files like below even though the app seems to run fine. I

How to set a background image for all pages in reactjs

I tried to set a image to all pages as background. I have tried to set the style of the body tag of index.html <body style="background-image: url(%PUBLIC_URL

error network while installing create-react-app

i've tried many times when installing create react app but it always error connection, but my internet connection is really stable npx create-react-app my-app

React Typescript: Type issue when passing multiple refs to child component

I have a main component that passes down multiple refs to Panels component like so import { useRef } from 'react'; import Panels from './Panels'; export const

Storybook-tailwind. How should I add tailwind to storybook

I want to add tailwind to storybook. So that Stories will render just like it will render on web. I used create-react-app project-name --template typescript to

React craco build fails on dokku: Could not find a required file. Name: index.html

I try to deploy my react app (craco) on dokku and I get this strange error on build: remote: -----> Build remote: Running build remote: remote:

How to get value from TextInput and set it with Button React Native?

I want to assign the username I get from a TextInput to a username variable via a button and output it in the text below. Meaning, if the user enters the userna

Salesforce OAuth 2.0 implementation CRA

I am attempting to grab the authorization code appended to the redirect uri using the OAuth2.0 Web Server Flow for Web App Integration seen here: https://help.s

Async/Await in useEffect(): how to get useState() value?

I have the following code snippet. Why is my limit always 0 in my fetchData? If I were to console.log(limit) outside of this function it has the correct number.

React Boot Strap with React Styled Components

I'm currently porting an old MVC website with Razor pages. I now want to use react with style compoents. Now I am using react on the front end, I want to know w

How to make a Chakra ui react theme drawer have a closeButton icon that aligns to the beginning of the drawer

I'm following this Chakra Doc on how to create a drawer slideout menu: https://chakra-ui.com/docs/overlay/drawer using the following component: import React fro

How to override bootstrap 5 modal scss property in react

Here I have use case to have a modal on the page header. since the page header has position:fixed bootstrap modal backdrop is overlayed at the top so unable to

Why render error in react v18 occures although I do not use legacy code?

Hy, guys! I have a render error in my react v18 code like this: Warning: react-dom.development.js:86 Warning: ReactDOM.render is no longer supported in React 1

How to create a type for file type `Record<string, File>` in zod

I use input type="file" and instead of saving data in FileData I use just plain object and created a type for it: Record<string, File>. It works well, but

Why am i getting " Expected an assignment or function call and instead saw an expression" error here?

Im getting " Expected an assignment or function call and instead saw an expression" error at the seconduse effect, it finds the socket port correctly, am i perf

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

I have a little bug in my console. Every time I try to run my app it breaks. FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory 1