Created
November 1, 2019 20:05
-
-
Save DanC5/7fa25ca1ae62bd9b60807215f24b92bf to your computer and use it in GitHub Desktop.
data-consumer-stream-context-blog
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
import React from "react"; | |
import { View, Text } from "react-native"; | |
import { BranchConsumer } from "./BranchContext"; | |
let DataConsumer = ({ deeplinkContent }) => { | |
/* | |
at this point, all key/value pairs embedded in the deeplink | |
may be pulled off the `deeplinkContent` object for in-app use | |
*/ | |
return ( | |
<View> | |
<Text>Access Deeplink Content in this Component!</Text> | |
</View> | |
); | |
}; | |
DataConsumer = props => ( | |
// pass deeplink data saved on App load into DataConsumer as props | |
<BranchConsumer> | |
{({ contextData }) => ( | |
<DataConsumer {...props} deeplinkContent={contextData} /> | |
)} | |
</BranchConsumer> | |
); | |
export default DataConsumer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment