fix(native-filters): Add empty text node before OutPortal (#22289)
This commit is contained in:
parent
3ffe7828a7
commit
ffff3e4bf4
|
|
@ -90,7 +90,14 @@ const FilterControls: FC<FilterControlsProps> = ({
|
|||
const renderer = useCallback(
|
||||
({ id }: Filter | Divider) => {
|
||||
const index = filtersWithValues.findIndex(f => f.id === id);
|
||||
return <OutPortal key={id} node={portalNodes[index]} inView />;
|
||||
return (
|
||||
// Empty text node is to ensure there's always an element preceding
|
||||
// the OutPortal, otherwise react-reverse-portal crashes
|
||||
<React.Fragment key={id}>
|
||||
{'' /* eslint-disable-line react/jsx-curly-brace-presence */}
|
||||
<OutPortal node={portalNodes[index]} inView />
|
||||
</React.Fragment>
|
||||
);
|
||||
},
|
||||
[filtersWithValues, portalNodes],
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue