Category "reactjs"

Close menu on container scroll

I want to close the react-select menu when scrolling a container outside of the select control. There is a closeMenuOnScroll prop in the official react-select d

Can't resolve '@blueprintjs/core/dist/blueprint.css'?

I have imported import '@blueprintjs/core/dist/blueprint.css'; but it gives an error like below ./src/index.js Module not found: Can't resolve '@blueprintj

Can't resolve '@blueprintjs/core/dist/blueprint.css'?

I have imported import '@blueprintjs/core/dist/blueprint.css'; but it gives an error like below ./src/index.js Module not found: Can't resolve '@blueprintj

How to deal with "Warning: validateDOMNesting(...): <tr> cannot appear as a child of <div>. " when using react-window to render table rows

I'm using react-window to create virtual tables with react-table 7 (and material UI tables). I'm embedding FixedSizeList instead TableBody. Something like this:

react-navigation swipe to go back doesn't trigger

I am using stack navigation and I want to use swipe to go back. However, even when I swipe the screen all the way to the right the app doesn't navigate to the p

Cannot find module './styles.scss' or its corresponding type declarations

i install yarn create react-app my-app --template typescript yarn add sass App.tsx import styles from "./styles.scss"; function App() { return <div classN

How to give Typography-like style to an input element with Material-ui?

I would like my Typography field to become editable, so I transform it into an input. Now I would like this input to have the same style. How to do it? I tried

How to change the background color of an ant.design InputNumber?

<InputNumber min={13} max={125} defaultValue={this.props.defaultValue} style={{ width: this.props.width, borderColor: this.

I want to use superagent in TypeScript-ed React

I want to use superagent in TypeScript-ed React. I try to write Tutorial with TypeScript and try to use superagent when reqest server. And I faced errors to use

React: Number input with no negative, decimal, or zero value values

Consider an input of type number, I would like this number input to only allow a user to enter one positive, non-zero, integer (no decimals) number. A simple im

How to snap Draggable's to Grid? (Material UI)

I am trying to make a card that is draggable, which is layered on top of a grid, and when moved, I want it to snap to the different sections of the Grid. I am a

How to configure redux-persist with redux-toolkit?

I have configured redux-persist with a traditional react-redux setup like this: onst persistConfig = { key: 'root', storage, whitelist: ['todos'], }; con

Make a button inside an element clickable while the element itself is also clickable

I have a simple sidebar, that has a bunch of list items in it, and a button right next to the list item, like so: I attached a click handler to the <li>

Approach to creating variants with styled components

What is the best way to create variants using styled components? Heres what i am currently doing. const ButtonStyle = styled.button` padding:8px 20px; bor

React 18 TypeScript children FC

I upgraded to React 18 and things compiled fine. Today it seems every single component that uses children is throwing an error. Property 'children' does not exi

React, different env files with create-react-app

I am trying to set up different environment files in a React project (using create-react-app). I following the official documentation but I am getting an error:

Difference between {Link} and {useNavigate} from 'react-router-dom'

Can anyone please explain the differences between {Link} and {useNavigate} from 'react-router-dom'? I am new to React and I see both {Link} and {useNavigate} ar

TypeError: Failed to load plugin 'jest' declared in '.eslintrc': Class extends value undefined is not a constructor or null

I was updating react-scripts to latest version i.e. 5.0.0 and started seeing above error. One article suggested to upgrade @typescript-eslint to version ^5.0.0

Cannot position react-perfect-scrollbar with scrollTop using React hooks

I have an array of objects being rendered in a table with a react-perfect-scrollbar instance. The code is the following: const myComponent = ({ myArray }) =>

Web3 error when trying to call contract methods

I encounter the following error while trying to run a dapp made using React, Truffle & Ganache. I'm also using web3 version 1.7.1. The problem is that the c