Category "reactjs"

How to set status code 404 instead of 200 for 404-page in Next.js

I have inquired about the way of setting 404 status code to 404-page in Next.js but the response I was given was that this is not true, that the status code is

How can i make my placeholder show on datepicker input?

I have a react-datepicker component inside my form and i am trying to put a placeholder which says "please select a date" but datepicker only shows the date.I d

How to import a compiled module from one app to another in npm workspace using webpack?

I'm using npm workspaces for the first time(node version v16.15.0 and npm v8.5.5 ). I need to import components from a react app in another app with some minor

Calculate the sum of values within an array of objects [duplicate]

I am trying to find the total sum for each item sold inside an array, like so: The array looks like this: [ { 'Some Title Item', '22',

How to install typescript + jest with create-react-app?

I want to install typescript and jest in a create-react-app-based app. I feel that since this is such a common installation choice there must be at least one "e

How to use socketio inside controllers?

I have a application created with Reactjs,Redux,Nodejs,MongoDB. I have created socketio in backend side. server.js const express = require('express'); const mo

How to remove duplicated react? (Invalid hook call)

When using libraries (I tried styledcomponents and react-router), an error appears in React applications: Warning: Invalid hook call. Hooks can only be called

Mock Service Worker returns empty

I'm new to react testing library. I am trying to test a simple component that call some apis and then it fills inputs with the data of these apis. But when I ru

Mock Service Worker returns empty

I'm new to react testing library. I am trying to test a simple component that call some apis and then it fills inputs with the data of these apis. But when I ru

Modifying Shopify Polaris Styles - Reactjs

I am trying to modify Shopify Polaris Button components colors for React, I tried to change style.css file but nothing happened. Any idea how to do so? App.j

How can I show error message when user email and password doesn't matched

I'm trying to add firebase email-password authentication using firebase and react firebase hooks. I want to show an error message when user try to sign in and t

How can I keep my useSelector() variable from a redux store updated after each dispatch?(Redux Toolkit)

So I'm using React Native with Redux Toolkit and I'm facing this issue where once I dispatch and decrement a store value, the variable inside the component that

React: loading two different images for mobile and desktop

Inside a React app, I need to load two different versions of the same image on mobile and desktop. Both images are long SVG files. For this I created an extra c

React state doesn't work, it doesn't rerender components

I have problem with react updating state. Well, I didn't touch react for a while and I want to remember some things so I've started from beginning. However, I f

React Native IllegalViewOperationException: StackOverflowException Android

CONFIGURATION I have this setup: RootNavigation import React from "react"; import { createNativeStackNavigator } from '@react-navigation/native-stack'; import

I m getting this error, i run my react native using expo

While trying to resolve module idb from file ` C:\Users\chouk\OneDrive\Bureau\my-app\node_modules\@firebase\app\dist\esm\index.esm2017.js , the package C:\Users

SetValues Formik Function disables Formik HandleSubmit

I have a form that can handle submission a couple of different ways. The difference is managed by a flag in the form Values that can either be true or false. I

create-react-app throws error: "Missing dependencies in package.json"

So I'm trying to run reactjs official tutorial and with the first line of code: npx create-react-app react-tutorial ...I get the following error: npx: inst

Problem with styling MUI Slider with pure CSS

In vain I try to style the mui slider with the help of CSS. The first approach it works perfectly. However, when refreshing the page, the slider is moved back t

React hidden navigation menu

I am working with ReactJS at the moment (I am very much a beginner). What I wanting to do is show/hide a menu component when a link is clicked in the site navig