Skip to main content
0 votes
1 answer
262 views

I'm trying to build a component which accepts a forwarded ref but also maintains and uses an internal ref (such that both component and caller can access the HTML reference). import { forwardRef, ...
Andrei V's user avatar
  • 7,518
3 votes
2 answers
201 views

I am trying to understand "forwardRef" more deeply referring the below page; https://react.dev/learn/manipulating-the-dom-with-refs Here it is mentioned that A component doesn’t expose its ...
copenndthagen's user avatar
4 votes
2 answers
153 views

I've been using React 19, and with the changes to how ref is handled, I noticed I need to adjust my code for components that inherit standard HTML element attributes. Previously, I used forwardRef ...
Raphael Elias's user avatar
3 votes
0 answers
267 views

I have a button react component and it defined as a forwardRef component: const Button = forwardRef<HTMLElement, ButtonProps>((props, ref) => { const { type, children, tagName, variant, ...
amir tbi's user avatar
  • 600
-1 votes
1 answer
418 views

import React, { useState, useImperativeHandle, forwardRef, useRef, useEffect } from 'react'; import Select from 'react-select'; import type { ICellEditorParams } from "ag-grid-community"; ...
Marvin Lee's user avatar
0 votes
1 answer
548 views

i am having issue with forwarding ref using Material UI's Textfield with customComponent as InputProps In short: I have a customized Mui Outlined Textfield. And it can either be input (just an ...
Jakub Koudela's user avatar
0 votes
0 answers
122 views

I am creating a react component that creates a custom html element and sets innerhtml using dangerouslySetInnerHTML, everything goes fine but the issue arises when I provide the dynamic type to the ...
Dhiraj sah's user avatar
0 votes
1 answer
240 views

this is my code : <Box display={'flex'} justifyContent={'space-between'}> <LocalizationProvider dateAdapter={AdapterDayjs}> <DatePicker ref={...
Samir Pm's user avatar
1 vote
1 answer
330 views

i have a component which renders conditionally and i pass a ref to it via forwardRef of React ,but when condition met and component renders, the ref still has not any value, what should i do? here is ...
Faraz's user avatar
  • 99
0 votes
0 answers
161 views

I have the following code taken directly from https://codesandbox.io/ the case is mantegnous/test-dnd-kit when testing in codesandbox it works well. I make a new create-react-app and install the ...
Kim Gabrielsen's user avatar
0 votes
1 answer
306 views

I'm working on a project in React 18, in TypeScript. There is a page header, inside of which is a Nav component. I'm using Bootstrap-react's NavBar component for that nav. I can do a manual toggle of ...
lkalliance's user avatar
1 vote
1 answer
528 views

I have a react-hook-form that takes in user data. For the user's cellPhoneNumber, I am using react-phone-number-input library's PhoneInputWithCountry. For my form, I have a 'Save Changes' button that ...
thakreyn's user avatar
0 votes
1 answer
600 views

I have the following use-case: Component A is a memoized (React.memo) component whose ref is being forwarded (React.forwardRef). Component B is a memoized component (React.memo) that renders multiple ...
XeniaSis's user avatar
  • 2,374
1 vote
2 answers
1k views

CodeSandbox Example for this issue. I have defined an icon library that exports several icons. Each Icon forwards a ref to its internal svg. Here's an example: type ReactIconProps = SVGProps<...
Naresh's user avatar
  • 25.9k
2 votes
1 answer
408 views

I have an component AddComment with forwardRef: function AddComment({ comment, setComment }: Props, ref: Ref<HTMLDivElement>) { return (<div ref={ref}> // code... </div>) } ...
kan's user avatar
  • 365

15 30 50 per page
1
2 3 4 5
12