Added new parent context

refs https://github.com/TryGhost/members.js/issues/5

- Adds new parent context with default values for all common context data we want to pass through

This adds base for using contexts (https://reactjs.org/docs/context.html) in our application as that allows easier overall base data and method sharing between different components instead of passing them down
This commit is contained in:
Rish 2020-04-28 01:04:30 +05:30
parent e8a05c252b
commit 2214a5048b

View File

@ -0,0 +1,10 @@
// Ref: https://reactjs.org/docs/context.html
const React = require('react');
export const ParentContext = React.createContext({
site: {},
member: {},
action: '',
brandColor: '',
onAction: () => {}
});