For functional components, use the useOUIAProps function instead
In class based components, create a state variable ouiaStateId to create a static generated ID:
state = {
ouiaStateId: getDefaultOUIAId(Chip.displayName)
}
This generated ID should remain alive as long as the component is not unmounted.
Then add the attributes to the component
{...getOUIAProps('OverflowChip', this.props.ouiaId !== undefined ? this.props.ouiaId : this.state.ouiaStateId)}
Get props to conform to OUIA spec
For functional components, use the useOUIAProps function instead
In class based components, create a state variable ouiaStateId to create a static generated ID: state = { ouiaStateId: getDefaultOUIAId(Chip.displayName) } This generated ID should remain alive as long as the component is not unmounted.
Then add the attributes to the component {...getOUIAProps('OverflowChip', this.props.ouiaId !== undefined ? this.props.ouiaId : this.state.ouiaStateId)}