Category "reactjs"

Create React App Error when trying to run command npx create react app: spawn UNKNOWN

When I try to run a simple npx create-react-app i received this error: D:\>npx create-react-app abc npx: installed 67 in 4.255s Creating a new React app in

Receiving "Attempted import error:" in react app

I am receiving the following error when trying to run my React app: ./src/components/App/App.js Attempted import error: 'combineReducers' is not export

Avoid runnning an effect hook when Context get updated

I have a component MyContainer which has a state variable (defined via useState hook), defines a context provider to which it passes the state variable as value

typescript: Cannot find module 'react'

I don't understand why it can't find it. $ cat tsconfig.json { "compilerOptions": { "sourceMap": true, "target": "es6", "jsx": "react", "typ

Redirect is not allowed for a preflight request

I have this problem where i get the response when trying to use a rest api: "Access to fetch at 'https://kollektivet.app:8082/api/login/' from origin 'https://k

Use custom theme - next.js, less, ant design

my goal is to modify default theme in antdesign but I cant achieve it. I even move from sass to less but still something won't work. I tried probably everything

Using redux with redux-persist with server-side rendering

I am trying to implement redux 4.0.0 with redux-persist 5.10.0 in an SSR application and am running into an issue where I cannot properly supply createStore() w

How to use Google fonts in React.js?

I had built a website with React.js and webpack. I want to use Google fonts in the webpage, so I put the link in the section. Google Fonts <link href="ht

How to use React Router with Laravel?

I needing use React Router with a Laravel project. But when I create router on the React Router and try access, Laravel accuse Route not exist error. How to c

Typescript input onchange event.target.value

In my react and typescript app, I use: onChange={(e) => data.motto = (e.target as any).value} How do I correctly define the typings for the class, so I woul

Unable to change react-select selected value color when menu is clicked

I am using react-select to select and search from a list. I need to change the text color of the selected text (that is visible in the search box) to gray when

Next.js Authentication with JWT

I am moving a project from React to Next.js and was wondering if the same authentication process is okay. Basically, the user enters their username and password

CardElement not showing ui components in react app ie `Card Number, MM/YY, CVC?

So my problem is that I cannot see the CardElement Ui component in the image below. It should be above the Order Total: $0 which is beside the payment method.

Make the dark mode button above all elements used DarkMode.js

I want to make the dark mode button above all the items on the website.I used DarkMode.js for the same.The button is hiding behind an image.How make its priorit

Display a PDF in the browser in a modal from blob data using react-pdf (@react-pdf/renderer)

I am using the handy react-pdf library to render/display/download pdf's in my React site. I have my PDF's stored on the server. I have a call to the server th

What is the difference between React component and React component instance?

I am reading this and it says: When a component is purely a result of props alone, no state, the component can be written as a pure function avoiding the

Having an issue with e.target.value returning Undefined in React

I have a feature where you can click an img and see a a list of names which are clickable....when you click a name, that persons image should take the place of

Can't seem to load custom fonts with Expo's Font.loadAsync

I'm using React Native with Expo, and it is all going well except for this one issue with custom fonts. I have my font Lobster-Regular.ttfin ./assets/fonts, and

React Router: How to stop redirecting until API returns a response?

I have a login page but that authenticates the login on router with a call to the backend. The backend returns a response 200 if the user is authenticated, and

react-custom-scrollbars can't get styling to work

I'm relative new to react but I'm trying to use a common custom scrollbar but I can't seem to get the styling to work, I also submitted this as an issue on gith