Category "reactjs"

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

Cannot get gridApi in Ag-Grid using React hooks in Typescript

I am using function component in react with typescript. Here is what my component looks like const Table = (props: TableProps) => { const [gridApi, setGridA

Expected 'this' to be used by class method

In my class, eslint is complaining "Expected 'this' to be used by class method 'getUrlParams' Here is my class: class PostSearch extends React.Component { c

Could not reach Cloud Firestore backend. Connection failed 1 times

i'm using a very simple code and fetching data from firestore import firebase from 'firebase/app'; import 'firebase/firestore' const firebaseApp = firebase.ini

Chakra-UI for windows

Any decent Chakra-UI tutorials for Windows? From setting up react to a full working demo? Can't seem to find any good medium articles on this. The official site

react-beautiful-dnd - Invariant failed: Cannot find droppable entry with id

I was following along with a react-beautiful-dnd tutorial that uses react component classes instead of hooks. I was writing an equivalent program with modern re

Disable Cypress from automatic scrolling

I am testing my application where I have very long side menu and I have a code like that: cy.get('tab').click({force: true}) The automatic scroll happens betwe

Uncaught Invariant Violation: Too many re-renders. React limits the number of renders to prevent an infinite loop

I'm trying to add a snackBar in order to display a message whenever a user signIn or not. SnackBar.jsx: import React from "react"; import PropTypes from "prop-