mirror of
https://github.com/BillyOutlast/posthog.com.git
synced 2026-02-04 03:11:21 +01:00
* Refactor Plugin Library Logic * add kea router * update types * add dynamic routing * upgrade kea * kea SSR with location for router * fix random undefined bug * wip changes * use selector * fix build fail * add netlify config * fix back button * don't redirect to root if still loading plugins * refactor actions and logic Co-authored-by: Marius Andra <marius.andra@gmail.com>
14 lines
467 B
JavaScript
14 lines
467 B
JavaScript
import React from 'react'
|
|
import { Provider } from 'react-redux'
|
|
import { getContext, resetContext } from 'kea'
|
|
import { loadersPlugin } from 'kea-loaders'
|
|
import { routerPlugin } from 'kea-router'
|
|
|
|
export function initKea(isServer = false, location = '') {
|
|
resetContext({
|
|
plugins: [loadersPlugin, routerPlugin(isServer ? { location } : {})],
|
|
})
|
|
}
|
|
|
|
export const wrapElement = ({ element }) => <Provider store={getContext().store}>{element}</Provider>
|