mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
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:
parent
e8a05c252b
commit
2214a5048b
10
ghost/portal/src/components/ParentContext.js
Normal file
10
ghost/portal/src/components/ParentContext.js
Normal 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: () => {}
|
||||
});
|
Loading…
Reference in New Issue
Block a user