Skip to content

Instantly share code, notes, and snippets.

@DanC5
Created November 1, 2019 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DanC5/7fa25ca1ae62bd9b60807215f24b92bf to your computer and use it in GitHub Desktop.
Save DanC5/7fa25ca1ae62bd9b60807215f24b92bf to your computer and use it in GitHub Desktop.
data-consumer-stream-context-blog
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