Skip to content

How do I extend the react aria props for auto-completion of attributes? #3631

Answered by reidbarber
PixeledCode asked this question in Q&A
Discussion options

You must be logged in to vote

The link you posted isn't public. Would you be able to post a code snippet here?

Update:

You'll want to add a type to the props:

import {AriaTextFieldProps} from '@react-types/textfield';

function TextField(props: AriaTextFieldProps) {
...

or extend them if you want to add your own custom props in addition to those:

import {AriaTextFieldProps} from '@react-types/textfield';

interface TextFieldProps extends AriaTextFieldProps {
  // Your own custom props...
}

function TextField(props: TextFieldProps) {
...

You can also look at how we do this in React Spectrum components for inspiration.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@PixeledCode
Comment options

@reidbarber
Comment options

Answer selected by PixeledCode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants