Ask questionsErrors "You returned a non-DOM element. You must specify a refKey in getRootProps"
downshift version: 3.2.10node version: 8.15.1npm (or yarn) version: 6.4.1emotion version: 10.0.10I'm using emotion element as a root one for downshift with specified refKey -
const containerStyles = css`
label: dropdown__container;
width: 100%;
`;
const Container = styled('div')(containerStyles);
// ...
<Container {...getRootProps(
{
refKey: 'ref',
...ariaLabelProps
}
)}>
{/* ... */}
</Container>
but downshift keeps complaining -
downshift: You returned a non-DOM element. You must specify a refKey in getRootProps
downshift: You must apply the ref prop "ref" from getRootProps onto your root element.
Answer
questions
silviuaavram
I will close this since https://github.com/downshift-js/downshift/pull/756 landed. Let me know if it still does not work.
Related questions