Property 'PasswordInput' doesn't exist on Carbon/react TextInput type definition

50 views Asked by At

im trying to use carbon/react on my react/typescript project, Im facing an issue where is typescript doesn't know PasswordInput propety on TextInput component, even tho the code works fine. this is my code:

import { Button, Form, FormGroup, TextInput } from "@carbon/react";

function App() {
  return (
    <Form>
      <FormGroup legendText="FormGroup Legend">
        <TextInput id="one" labelText="email" type="email" />
        <TextInput.PasswordInput
          id="two"
          labelText="password"
          type="password"
        />
        <Button>Submit</Button>
      </FormGroup>
    </Form>
  );
}

export default App;

i get a typescript error in TextInput.PasswordInput says:

Property 'PasswordInput' does not exist on type
 'ForwardRefExoticComponent<TextInputProps & RefAttributes<unknown>>'

this is docs link of how to use password input: textinput toggle password visibility

0

There are 0 answers