0

In react-native-paper if I am using TextInput with Icon like this it works fine.

<TextInput
      label="Password"
      right={<TextInput.Icon icon="eye" />}
/>

But if I export the Icon part to custom element it stop showing the Icon. Am I doing something wrong here?

const MyCustomIcon = () => {
  return <TextInput.Icon icon="eye" />;
};

const MyComponent = () => {

  return (
    <TextInput
      label="Password"
      right={<MyCustomIcon />}
    />
  );
};

export default MyComponent;

Thanks.

Xinecraft
  • 81
  • 1
  • 7
  • here is example https://blog.logrocket.com/complete-guide-textinput-react-native/ –  Jan 02 '23 at 13:56

0 Answers0