question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PinInput not support ref property

See original GitHub issue

🐛 Bug report

PinInput not support ref property.

💥 Steps to reproduce

Create project with react, typescript and chakra-ui and try pass a Ref for a PinInput.

🧐 Expected behavior

PinInput accept a Ref.

🌍 System information

Software Version(s)
Chakra UI 1.1.6
Browser Google Chorme
Operating System Mac OS

📝 Additional information

<PinInput ref={forwardedRef} colorScheme="pink" otp onChange={setValue}>
  <PinInputField />
  <PinInputField />
  <PinInputField />
  <PinInputField />
  <PinInputField />
</PinInput>
(JSX attribute) ref: React.ForwardedRef<HTMLInputElement>
Type '{ children: Element[]; ref: ForwardedRef<HTMLInputElement>; colorScheme: string; otp: true' is not assignable to type 'IntrinsicAttributes & PinInputProps & { children?: ReactNode; }'.
  Property 'ref' does not exist on type 'IntrinsicAttributes & PinInputProps & { children?: ReactNode; }'.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
TimKolbergercommented, Feb 4, 2021

You can use the Controller component of react-hook-form to add components your form, which manage their state in react, and not in the DOM. Please have a look at this codesandbox for an example implementation of NumberInput and PinInput.

1reaction
with-heartcommented, Apr 22, 2021

@MikeMajara Reproduce in CodeSandbox please

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use the ref property in a react-native-paper TextInput
I'm trying to use the react-native-paper TextInput as a field to show a location search input. This doesn't seem to work because the...
Read more >
property ref does not exist on type intrinsicattributes - You.com
PinInput not support ref property. Steps to reproduce. Create project with react, typescript and chakra-ui and try pass a Ref for a PinInput....
Read more >
Unlock the Secret Power of React Hook Form - CopyCat Blog
In this article, we'll dive into getting started with React Hook Form and why the library is useful in building forms in a...
Read more >
Espruino Hardware Reference
Set the mode of the given pin. auto / undefined - Don't change state, but allow digitalWrite /etc to ...
Read more >
react-pin-input - npm
React component for PIN like input. Latest version: 1.3.0, last published: 5 months ago. Start using react-pin-input in your project by ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found