amazon-chime-sdk-component-library-react
amazon-chime-sdk-component-library-react copied to clipboard
allow "ref" attribute support on elements
Along with the "Focusable" Interface suggested in https://github.com/aws/amazon-chime-sdk-component-library-react/issues/252, it would be nice if components supported adding of "ref" attributes so that parent components can call them for focusing and blurring
Also for things like attaching to events via .addEventListener( etc.
For any others arriving at this ticket, this is an enhancement we have backlogged to add ref support to all elements.
As an immediate workaround, you can always wrap the component with your own ref to access it
// use whatever browser API you prefer to grab the element
console.log(myRef.firstElementChild)
return (
<div ref={myRef}>
<SomeComponent />
</div>
)
Adding my vote for this as well. Ideally, I can pass in a onChange handler to the device selection components as a prop. Using a ref will address this as well though.