defaultPersistedState
Summary: adding a `static defaultPersistedState` which plugins can use to populate their persistedState for the first render. Reviewed By: passy Differential Revision: D10446987 fbshipit-source-id: eb37553db7bbec31edf5b4972176e71f303639fe
This commit is contained in:
committed by
Facebook Github Bot
parent
d48f93edea
commit
4090c2d096
@@ -135,7 +135,12 @@ class PluginContainer extends Component<Props, State> {
|
||||
const props: PluginProps<Object> = {
|
||||
key: pluginKey,
|
||||
logger: this.props.logger,
|
||||
persistedState: pluginStates[pluginKey] || {},
|
||||
persistedState: activePlugin.defaultPersistedState
|
||||
? {
|
||||
...activePlugin.defaultPersistedState,
|
||||
...pluginStates[pluginKey],
|
||||
}
|
||||
: pluginStates[pluginKey],
|
||||
setPersistedState: state => setPluginState({pluginKey, state}),
|
||||
target,
|
||||
deepLinkPayload: this.props.deepLinkPayload,
|
||||
|
||||
Reference in New Issue
Block a user