Category "reactjs"

Prevent re-sort on data change or while row is being edited

On react-table when the table is sorted and data changes, the table can either reset (go to default sort state) or re-sort (by putting the edited row in the cor

emotion css feature is not rendering the styles (React)

I´m using Webpack 4, Babel 7 and Emotion 10. I installed @emotion/core @emotion/styled and the recommended plugin babel-plugin-emotion styled is working

"Peer dependency not installed" warning, but they are installed

On npm install, I am getting the following "peer dependency not installed" warnings: npm WARN [email protected] requires a peer of react@^0.14.1 but none is i

Ubuntu create-react-app fails with permission denied

I'm getting a weird error: Unhandled rejection Error: EACCES: permission denied, mkdir '/home/ubuntu/.npm/_cacache/index-v5/14/36'atus I just install npm (6.

react native : custom component with color parameter

Im doing the exercises to learn react native on codecademy. I am told "In React, properties are passed as objects on the first parameter to our components. You

React-testing-library: changes due to input

I'm trying to test that a component updates as it should due to changes in an input element. I use the fireEvent.change()-function, and if I then check the valu

React Link doesn't refresh the page

I have this code: <Link to="/dashboard" style={{ color: '#A4A4A4' }}>Dashboard</Link> As part of my app, but if i'm currently viewing the /dashboa

How to make reactjs website responsive using material-ui

I am working on reactjs project using material-ui. Web-page is working perfect on desktop layout but when I switch layout to responsive (mobile). Than all the t

How to prevent re-rendering of components that have not changed?

I have a component that consists of several other components such as text fields, and when an input is made to the text field, all other components are re-rende

Target Active Link when the route is active in Next.js

How to target the active Link in Next.js like they way we do it in React-Router-4? Meaning, give the active link a class when its route is active?

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