Category "reactjs"

Implementing React table expanded rows

It's my first time to use react-table librabry. I am struggling for the previous couple of days how to implement the expansion functionality using useExpanded h

"Expected an arrow function after this type parameter declaration" error

I got this error while running yarn start: $ yarn start yarn run v1.22.17 $ run-s build exec $ babel src/ -d lib/ SyntaxError: .../src/App.js: Expected an arrow

Apollo useQuery running twice instead of once when firing multiple queries

in my <Homepage/> component I fetch an authed user and posts using Apollo and useQuery. I can see in my network tab that each one of these queries is runn

How to call more than one function in javascript onclick event? [duplicate]

<Button onClick={(e)=>setId(_id); handleDelete()}>Delete I tried this way, but it gives error.

CKEditor getting displayed twice

I am trying to integrate CKEditor with antd in a React application. This is my code: <Form {...layout} form={form} name="control-hooks" onFinish={onFinish}&

React scroll to element (ref current is null) problem

I have a problem I'm not able to solve. The app got a component where a do looping array and making multiple elements off it. Then I want to make buttons in ano

React + vitejs + storybook setup

I am trying to setup react that is bundled with vitejs and storybook after running the setup command as per vitejs docs storybook vite builder storybook runs bu

How to make button which swaps out the title with an input field that allows the user to edit and save the title

i'm asked the following question. "Each article in the array should have an edit button which swaps out the title with an input field that allows the user to ed

React Native map with Google API, Search bar is not compactable with screen width

This is the code for React Native Map using Google Map's API. import React, { useEffect, useState } from 'react'; import { PermissionsAndroid, StyleSheet, View,

Couldn't work hooks for fetching API in Nexr JS + Open Weather API

I would like to use the Open Weather API to get monthly temperature data for each City. I am using Hooks to get temperature data but I am getting an Object erro

Not able to send files data from front-end (react.js) to back-end (node)

I have an application that stores to its state files' content, whether images, audio or both, as shown here with the mediaAudio object key: In my react.js code

MUI Radio button disabled change value when Select drop down changes

My problem is that when I change a value in a dropdown I want to disable two radio buttons and change to the correct radio button. I am able to disable the radi

Why do “specific” component renders a more “generic” one?

This is straight from reactjs site. function Dialog(props) { return ( <FancyBorder color="blue"> <h1 className="Dialog-title"> {

Conditionally render a React component depending on a descendant's render

We use Reakit dialogs to prompt users to take an action in our React web app. On some pages, we have specific text related to the action and would like to rende

Trying to loop through firebase and display each object as a card React

My data is structured like so [1]: https://i.stack.imgur.com/dWsr3.png I am trying to loop through the database and put the data from each card into props for m

Next.js Navbar gives a warning of Target Element not found when clicked

I am currently working on a next.js app, which contains a connect wallet button found to the right of the navbar, with the navigation links to the left of the n

How do I style a component that has `styled-components` nested in it?

I am new to styled-components. I'm trying to set styles for MyComponent to apply to styled-component. export const Relative = styled.div` position: relative;

Is there a way to override what useMemo does to determine if there's a change?

useMemo(() => expensiveFunction(), [deps]) re-executes the expensiveFunction when the deps have changed. I was wondering... is there a way to control how Re

React & CSS: How to override :root in css module in React?

Short question. I'm trying to build a theme selector for an app and was wondering how to change the :root of a css module in a press of a button in jsx.

How to pre-download items from a JSON list array in React JS?

Here the Codesandbox example. I have a list array of songs: const tracks = [ { name: "Sunny", src: "https://www.bensound.com/bensound-music/