Files
posthog.com/kea.js
Sam Winslow 126f21e8cd Email gated signup integration (#1742)
* remove nested info from HubSpot request

* introduce feature flags to constants file

* set experiment variant on mount

* routing and flag logic for email flow

* old flow (skipDeploymentOptions)

* try routing everything through signup page

* add a call to reload feature flags; show that it still does not work

* logic to set, persist, and update active experiment variants

* changes and hydration from feature flags

* selector for activeVariant, minor cleanup

* bugfix

* capture with set_once

* send variant name as an event prop, use a more description user prop name

* render nothing on the intermediate page if a redirect should occur

Co-authored-by: kunal <kunal@kunals-MacBook-Pro.local>
2021-08-11 17:22:53 -04:00

15 lines
541 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'
import { localStoragePlugin } from 'kea-localstorage'
export function initKea(isServer = false, location = '') {
resetContext({
plugins: [loadersPlugin, routerPlugin(isServer ? { location } : {}), localStoragePlugin],
})
}
export const wrapElement = ({ element }) => <Provider store={getContext().store}>{element}</Provider>