Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate LoginView to hooks #5092

Merged
merged 7 commits into from
Oct 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix ref
  • Loading branch information
reinaldonetof committed Jun 12, 2023
commit 4b6f6b2acbcc68b2a458b91b11f505cc684a4e38
6 changes: 4 additions & 2 deletions app/containers/TextInput/ControlledFormTextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Control, Controller } from 'react-hook-form';

import { FormTextInput, IRCTextInputProps } from './FormTextInput';

interface IControlledFormTextInputProps extends IRCTextInputProps {
interface IControlledFormTextInputProps extends Omit<IRCTextInputProps, 'inputRef'> {
control: Control<any>;
name: string;
}
Expand All @@ -12,6 +12,8 @@ export const ControlledFormTextInput = ({ control, name, ...props }: IControlled
<Controller
control={control}
name={name}
render={({ field: { onChange, value } }) => <FormTextInput onChangeText={onChange} value={value} {...props} />}
render={({ field: { onChange, value, ref } }) => (
<FormTextInput onChangeText={onChange} value={value} inputRef={ref} {...props} />
)}
/>
);