Category "reactjs"

React router, redux, electron: router isn't rendering

I'm trying to get react-router to work in an electron app. I'm using a boilerplate and stripped away some of the stuff I don't want but that should provide a pr

Secure Node API for React Front End

I’m building a React application with a Node backend. In the backend I have an API that just talks to a database and I can deploy the API and the React ap

Unable to save to array React state from the response from the server

I'm trying to save my response.data to my array state of React, but it never stores the correct array. But when I do a temporary array it works. const [allstude

Apollo `useMutation()` stuck loading inside Next.js component

The following form component in Next.js submits without errors but never completes the mutation. Instead it get's stuck in the loading state. import React, { us

How can I increase and decrease the quantity in reactjs?

I have a button and an input form. When clicking the button, my product quantity decreases by 1 and increases quantity when submitting the form. Quantity increa

TailwindCSS 3 classes doesn't override previous classes

I am facing an issue which is mind-numbing in the world of CSS. TailwindCSS 3 classes just doesn't override previous classes. For example, there is this compone

I18next and Webpack

I'm starting with Webpack and find problem with react i18next hook-useTranslation. // webpack.config.js const path = require('path') const HtmlWebpackPlugin = r

dangerouslySetInnerHtml doesn't update during render

So I made a component for including content-editable components in my app. I copied it from some gist I believe, then edited to what i needed. The code is belo

How to test a required input field with React Testing Library and Jest?

I tried to test a required input field with React Testing Library and Jest by testing the existence of the popover, but I failed. I tried several variants and n

Ant Design reset select

I have 2 <Select>'s. The values in the second are dependant on the selection made on the first. When I change the selected item in the first, the availabl

Set default header for every fetch() request

Is it possible, using the fetch API, to set default headers for every single request? What I want to do is set an Authorization header whenever there is a json

Passing props to dynamically rendered components in React

I have a page that is displaying several of my star components that each have their own name and a prop called starType I am generating several different of the

React Native Context rendering a blank screen when wrapped inside <Provider>

I'm trying to build a simple blog native app using context and have stumbled upon an issue to which I can't find a root to. Here's the structure of it: /context

How to change zIndex in react-select drowpdown

I am using the react-select library to create autocomplete drop-down. I have used 2 drop-down parallel if 2nd has some data & I open first one then the zInd

VirtualizedList: You have a large list that is slow to update

I use FlatList with large number of items. I get following alert from Expo XDE. VirtualizedList: You have a large list that is slow to update - make sure

TextareaAutosize With Formik?

I am using react-textarea-autosize and formik and I am wondering how to properly hook the change events of formik to TextareaAutosize? <Formik

Converting Flow to TS - 'Component cannot be used as a JSX component' when imported from installed library

I have recently started to convert an older React 15 with Flow types codebase to an up-to-date CRA with TS. I used the flow-to-ts script to convert all the file

Expo Push Notifications - Disable notifications in a specific screen

How can I disable showing notifications in my Expo app when the user is in a specific screen? I am currently designing a chat screen, and I want to disable push

reactjs project working fine on local...but not working after deployment...any suggestion?

I'm trying to deploy my first reactjs app. (It's a quiz app) In local the app is working fine.. after deploy is not working as expected. Here you can find the d

How to query by text string which contains html tags using React Testing Library?

Current Working Solution Using this html: <p data-testid="foo">Name: <strong>Bob</strong> <em>(special guest)</em></p> I