Category "reactjs"

How to define default mock data for relay?

I am doing unit tests on a react app that is using relay as a graphql client when testing , i get mocked data with like this : title: '<mock-value-f

Unable to load Maven meta-data from https://jcenter.bintray.com/org/webkit/android-jsc/maven-metadata.xml Issue in react native

FAILURE: Build failed with an exception. What went wrong: Could not determine the dependencies of task ':app:lintVitalRelease'. Could not resolve all artifacts

What is `react/no-unused-state` and why is it bad?

Can someone explain exactly what no-unused-state means and why is it considered bad practice? I can't seem to find any information other than the following sen

custom button component + tailwind styles being purged

I want to create a button component like this: function Button ({ color }) { return ( <button className={`hover:bg-${color}-300 bg-${color}

What is the difference between the different ways of importing material-ui components?

From reading the material-ui documentation and online examples, there seem to be different ways of importing the same item: import TextField from 'material-ui/

Issue in react MUI table in horizontal scroll when i show button in right side of table on hover

My EditDeleteButton button cell that I am showing button based on hover in a row that working fine I make EditDeleteButton to position: "absolute" and table to

.firstElementChild, .lastElementChild... what about those in between?

I'm trying to update an existing markup element in React rather than replacing an entire fragment. When I assign a div container element to a variable with .get

Rollup & Typescript type declarations with absolute imports

I'm making React component library. Project structure is something like: src/ components/ utils/ hooks/ Now I'm trying to generate types (.d.ts.) file

How to specify custom mouse cursor with JSX style

How can I specify a custom mouse cursor using a JSX inline style? This works fine: <Component style={{ cursor: 'crosshair' }} /> but I cannot seem to

Type 'Element[]' is missing the following properties from type 'Element': type, props, key

I have the standard arrow map ES7 function with Typescript and React environment: const getItemList: Function = (groups: any[]): JSX.Element => group.ma

Rollup & Typescript type declarations with absolute imports

I'm making React component library. Project structure is something like: src/ components/ utils/ hooks/ Now I'm trying to generate types (.d.ts.) file

integrated google analytics in react application but blocking analytics.js by content-security-policy which is added from backend asp.net core

string script_src = $"script-src 'self' 'unsafe-eval' 'unsafe-inline';"; context.Response.Headers.Add("Content-Security-Policy", new StringValues($"default-sr

What is the difference between React Native and React?

I have started to learn React out of curiosity and wanted to know the difference between React and React Native - though could not find a sati

proxy not working for react and node

I'm having issues with the proxy I set up. This is my root package.json file: "scripts": { "client": "cd client && yarn dev-server", "server"

Why do we need middleware for async flow in Redux?

According to the docs, "Without middleware, Redux store only supports synchronous data flow". I don't understand why this is the case. Why can't the container c

Next.js error "Unhandled Runtime Error TypeError: Cannot read properties of undefined (reading 'scrollTo')"

While making a portfolio website with Next.js, this is some sort of scrolling error that I'm getting from .next folder in my project folder. Whenever I'm trying

npm run build fails after updating npm (EACCES: permission denied)

I have a CRA (create-react-app) and I updated npm. Following, npm run build started to fail with error: EACCES: permission denied, rmdir 'PATH/build/static/css

sass version is incompatible

I have problems with my code. I installed dependencies one by one, but the last of them was sass. I need or better to say I have to install node-sass version ^4

SVG sprite images not showing on iOS & Safari using React

I am trying to use my svg images with a sprite file. Importing sprite file in relevant component and using custom Svg component to render images with symbol id'

Argument of type (key: string, id: string, pagination: number) => Promise<void> is not assignable to parameter of type Boolean

Not sure what is the matter here, but I am trying to follow this documentation: https://swr.vercel.app/ with this setup of my own: import React, { useEffect } f