react version: #17322
Original: https://github.com/facebook/react/pull/17322#issuecomment-613104823
Currently only a single value from useOpaqueIdentifier (unreleased) can be passed to HTML attributes. However, there are HTML attributes which support multiple ids (IDREFS) like aria-labelledby. This can be used to implement various patterns such as:
```jsx
export default function App() {
const taxpayerId = React.unstable_useOpaqueIdentifier();
const spouseId = React.unstable_useOpaqueIdentifier();
const w2GrossId = React.unstable_useOpaqueIdentifier();
const dividendsId = React.unstable_useOpaqueIdentifier();
return (
Most helpful comment
@eps1lon I believe you can safely get around this for now by using a custom class that extends
Arrayand overridestoString.