Questions tagged [unform]

8 questions
6
votes
1 answer

Datepicker component breaking an edit screen, using @unform and react-datepicker

I created the following component to select dates in UnForm: export default function DatePickerInput({ name, ...rest }) { const datepickerRef = useRef(null); const { fieldName, defaultValue = '', registerField } = useField(name); const [date,…
0
votes
1 answer

How to access input reference from another file using Unform?

I'm trying to use unform with the following structure: Component/inputRadio.ts: export const TextInputInput: React.FC = ({ name, ...props }) => { const inputRef = useRef(null); const { fieldName,…
0
votes
0 answers

Reset form field (Unform) after submit

I'm using react with javascript along with a library called Unform (( https://github.com/Rocketseat/unform ) I have a form with a single field and I wanted to clear this field after clicking "send".
0
votes
0 answers

How can I add the - (minus) sign to symbolize negative numbers?

I'm using React with, Unform + React Input Mask and inside the beforeMaskedStateChange function of the React Input Mask library I have the following masking function: Here I take the values ​​typed by the user and do the masking at the same time the…
THIAGO DE BONIS
  • 760
  • 7
  • 22
0
votes
1 answer

React - how to use map to pass an array of options on input of type unform select

I have a select input where I want to pass an options array object using map but when rendering my page only one option even when the array I'm using in the map has several items it insists on presenting only one below all the code: export default…
Ruben Martins
  • 161
  • 2
  • 5
  • 14
0
votes
1 answer

React with yup error Type 'undefined' cannot be used as an index type. TS2538

I'm using yup to invalidate the forms, when they are invalidated I want this function to return the errors, but it always gives an error in validationErrors[error.path], it gets Type 'undefined' cannot be used as an index type import {…
Colgate
  • 15
  • 5
0
votes
0 answers

Can't use Options props on React-select with Unform

Hey guys i'm trying to use select component with unform and in their documentation is recommended to use React-select, they recommend create my own custom Select with this code: import React, { useRef, useEffect } from 'react'; import ReactSelect,…
0
votes
0 answers

Exclude time with react-datepicker and unform libraries

I'm trying to add a trigger on my site when I pass an hour in the first field, the second field must not allow the user to add an hour that's before the hour of the first field and can't do it with onChange because I'm using unform library and I…