Category "reactjs"

Return React component as object value and bind props to it

There's one global hook which returns react components when used: const { SomeComponent1, SomeComponent2 } = useHook({ prop1, prop2 }) How do I pass props to

Flask serve react app build without interfering with Flask-socket.io requests

Im attempting to serve a react app via flask using the catch-all found in the top answer of this question, which works great for serving all of the build files,

Cloudlinux NodeJS demands to store node modules for application in separate folder (virtual environment) pointed by symlink called "node_modules"

I was looking to deploy my Nodejs/TypeScript web application to my cpanel shared hosting. But, I am getting an error: * Cloudlinux NodeJS Selector demands to s

Webpack module federation lazy loading remoteEntry.js

Am I able to lazy load apps' entry files when I am using React with ReactRouter? When I enter page there are many requests for remoteEntry.js files for each app

useInfiniteQuery but all the data re-rendered every refetch

I'm trying pagination by useInfiniteQuery in React Query, it's refetch data perfectly, but there's a problem that each time new data added, the page re-render a

handle multiple checkboxes and complex data structure (reactjs)

Since I am pretty new to React and also not a huge expert on JS especially ES6, I wonder how to make my code (that works) prettier and refactor it. I want to h

Property 'current' does not exist on type '[boolean, Dispatch<SetStateAction<boolean>>]'.ts(2339)

I am adding cursor animations to a React/Typescript project and in researching came across a CodePen (Animated Cursor React Component) that works perfectly well

react evironment variables .env return undefined

I am building a react app and i need to fetch data from my api, now i want to store the api url as an environment variable. I have my .env file, i have dotenv i

How can i read data from ReferenceInput in React admin?

When I use the referencinput, it sends a request to the server, is it possible to somehow read what I received from the referencinput server and use these value

Changing inner HTML using props in styled-components

I want to add a styled component in react and pass props in it. Depending on the props the inner html should be changed. So is there some CSS property or someth

How to fix "You may need an additional loader to handle the result of these loaders." React-Leaflet map

I try to load a react-leaflet map but I receive error like this: Failed to compile. ./node_modules/@react-leaflet/core/esm/path.js 10:41 Module parse faile

Error: Expected undefined to be a GraphQL schema

I am getting an error which says " Error: Expected undefined to be a GraphQL schema." Please check what issue is this when I move to localhost:3000/graphiql it

react native map is not updating custom style directly

I have created a custom map style using react native maps but sometimes it shows a default map for 1-2 seconds then a new style will update. Is there any way we

React, Emmet, Visual Studio Code, and CSS-Modules

Is there a way to configure emmet in visual studio code to use React's CSS modules? When I type... div.container and hit tab, it becomes <div className="con

TypeScript: Interface cannot simultaneously extends two types

I'm writing a React app using TypeScript. I use material-ui for my components. I'm writing a custom wrapper for material-ui's Button component. It looks like th

Set acitve classname to multiple items in react js (map)

I need to set the active classname to multiple onclick items inside a .map I have implemented by it only keeps track of current click active index I need the li

" Objects are not valid as a React child (found: object with keys {})."

class Home extends PureComponent { render() { const { proList } = this.props; return ( <HomeWrap> <B

Select all and Select None buttons in Autocomplete Material UI React

I want to implement two buttons Select All and Select None inside Autocomplete React Material UI along with checkbox for each option.When Select All button is c

Password matching validation using the Joi schema in React not working

I want to create a password change form in React. Here is the code of my component : import React, { Component } from "react"; import Joi from "joi-browser"; im

Is there a way to update a readonly array of objects

I do have two arrays arr1 = [1,2,3,4] //readonly array arr2 = [1,2,3,4,5,6,7] arr1 is the main array and I want to update it with contents from arr2 so that wh