Last active
October 13, 2020 17:29
-
-
Save codeBelt/ce1761665e965313a56c0ba00a42afa0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const PortalIn = (props) => { | |
const { addPortalItem, removePortalItem } = useContext(PortalContext); | |
useEffect(() => { | |
addPortalItem(props.portalType, props.children); | |
return () => removePortalItem(props.portalType); | |
}, [props.portalType, props.children]); | |
return null; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment