Category "reactjs"

How can I expose React Hook outside of my React Functional Component

I have a React Functional Component like this: export const MyParentComponent = (props: Props) => { const [myObjects, setMyObjects = React.useState< M

(Gatsby) Easiest way to diverge from the `SEO.defaultProps` on a per-document basis?

Most of the pages on my website are in Norwegian— Seo.defaultProps = { lang: `no`, ... } Some articles, however, are in English. I use some automatic

React-query mutation dosent refresh

I have another fetch of "SpecificList in another component, but when posts excutes it dosent refetch it only refetches on rewindowfocus? What could the reason b

I get an error about "browserObject" on the console only in case of chrome in react app

I'm making an app with React. Only in Chrome, the following error is output both on localhost and after building and deploying. it is error. I did not find the

I want to display fetched data from api in form columns (auto fill data) in React.js and Mysql

i am using onKeyUp event for fire api without submitting the form and i fetched data in response successfully if Mobile number matched. But i don't understand h

Change color of Pathlayer on Click, MapBox DeckGl React.js

I have a mapbox React.js component implemented with DeckGl I am trying to make my Pathlayer color changes on evenry mouse click (onClick), using onClick, getCol

Working with promises in a React class component

I have this module to fetch data using the Spotify API: const Spotify = { getAccessToken() { ... }, searchTrack(searchTerm) { const accessToken = Spoti

I am using React Bootstrap Table and function base component and I need to save page number, size per page and text filter for reuse

I need to save page number, size per page and text filter for reuse. Suppose I'm at page 3 and text Filter is "submitted" and sizePerPage=50. Then I got to ano

Task not found: "react-scripts:start"

I've configured tailwind.css to my react project and edit the react scripts according to "scripts": { "build:css": "postcss src/styles/index.css -o src/styl

Getting 'could not resolve "jest-config" package from the "jest" npm package directory.'

I am getting "jest-config" package from the "jest" npm package directory error when I try to run e2e test for android application, I am using detox test -c a

How to prevent svg on top of other div of triggering mouseleave

I have an issue with mouseleave. (React/Typescript/CSS/HTML project). Situation (see picture at the bottom) I got two div elements <> <div id="main"

Can I use expo packages in react native cli?

Can I use expo packages in react native cli ?

react I want to change the order

When the button is pressed, I want it to swipe in the following order: yellow, red, blue, green.

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