Category "reactjs"

undefiined useContext destructure

i am trying save user object in context but i am gettin g undefined this is my context: import { createContext } from "react"; export const UserContext = creat

React MUI Autocomplete "options.filter" is not a function

I wish to create a autocomplete search bar with my own custom call to the backend, which searches through a list of tickers. <Autocomplete mu

How to get styling to refresh with new variable in react native

Using a global variable to store dark and light mode variable. In app I have place where variable is changed as user toggles if they want dark or light theme, b

How to collapse Siblings with Headless UI

To make the accordion component with Headless UI, I have used Disclosure component. But I have a problem to control the collapse/expand state for it's siblings.

I am struggling to position/ remove whitespace from duplicate components

Here you will see the start of the NotesFromCoachesForWrestlers component circled The problem is When the notes on the component on the left increase the comp

How to jest.mock an ES6 module import?

I've moved a load of helper methods into a npm published library, but some of them are being mocked in the unit tests and I can't figure out how to mock the new

How can I run React with hooks in an iFrame

I am writing a React application in which I would like to dynamically render React components through an iFrame. I have a code editor on the webpage that allows

Testing a React context with jest and consume it in the test file

I'm now trying to test a simple React class context that is used to sets a currency to the global state. However, I didn't know how to to consume the context in

Uncaught Error: Objects are not valid as a React child (found: object with keys {message})

I have ReactJS application which receives data from SpringBoot API. I am successfully able to receive the data from SpringBoot as seen through console.log(). B

How to replace a specific position of a main grid (array of arrays)?

I'm coding a minesweeper and I got the UI and I can't modify it. I've made the grid for different sizes but now I need to push the mines into it, I created a fu

Ant Design's Time Picker color

Is there an easy and quick way to modify these colors? Thanks in advance

Using ant design, how can i implement a text area as a search?

I'm trying to create an search input box using antd, but the input box doesnt seem to allow for autosize (when more than one line of text is input, it doesnt ge

Encountring very fundamental problem with react, why item.id in my case is increasing by +2?

hi i have just started learning react and facing problems in understanding fundamentals , here i am creating basic todo app question is why item-id in seq of 1,

Material UI Styles

Every time I run npm start in vscode I get weird material UI errors like Module parse failed: D:\Websites\rugprints\rugprints\node_modules\@mui\material\node\st

SetState not updating the value in react js functional component

in a functional component i need to show the message to user that email is being sent i am changing the html element text by set state here is the code const [v

How to re-render react-table in .js when data changes in another .js

I am new to react-table and trying to re-render a react-table when data supplied to it changes. Is there anyway to do so? I have tried using useEffect() with no

Where is the user data stored after decoding it from the token?

Where is the user data stored after decoding it from the token? I'm using react , and the Jwt token is stored in local-storage .

How do I fit the entire content in one page when printing it to PDF?

I am using jspdf and html2canvas. Printing the component would make the footer go to the next page. How can I set this where it will dynamically resize to fit i

A problem that i am having making conway's game of life in react (nextjs). when i press the Random button while it is running, it starts flickering

Here is a the code for you to try. both button works fine while the game is paused or running very fast, but if i set the timeout above 100 or 200 ms and the ga

A problem that i am having making conway's game of life in react (nextjs). when i press the Random button while it is running, it starts flickering

Here is a the code for you to try. both button works fine while the game is paused or running very fast, but if i set the timeout above 100 or 200 ms and the ga