react-stripe-elements
react-stripe-elements copied to clipboard
Error integrating react-stripe-elements to project
Hi, I'm encountering a react.createElement type is invalid error while integrating react-stripe-elements to a project (in this step)
Dependencies used: [email protected] [email protected] [email protected]
fragment of the relevant code:
const store = rehydrate();
const renderApp = Component => {
render(
<AppContainer>
<StripeProvider apiKey="[key_hidden]">
<Router>
<Provider store={isProduction ? store : hotRehydrate()}>
<App />
</Provider>
</Router>
</StripeProvider>
</AppContainer>,
document.getElementById("root")
);
};
renderApp(App);
if (module.hot) {
module.hot.accept(() => renderApp(App));
}
full error details:
warning.js:36 Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in.
printWarning @ warning.js:36
warning @ warning.js:60
createElement @ ReactElementValidator.js:171
patchedCreateElement @ patch.dev.js:164
renderApp @ index.js:39
(anonymous) @ index.js:55
./src/index.js @ app.e2c0fc4dfb8973baf072.js:7439
__webpack_require__ @ app.e2c0fc4dfb8973baf072.js:687
fn @ app.e2c0fc4dfb8973baf072.js:110
(anonymous) @ client:8
0 @ app.e2c0fc4dfb8973baf072.js:7486
__webpack_require__ @ app.e2c0fc4dfb8973baf072.js:687
(anonymous) @ app.e2c0fc4dfb8973baf072.js:787
(anonymous) @ app.e2c0fc4dfb8973baf072.js:790
ReactCompositeComponent.js:327 Uncaught TypeError: Cannot read property 'unmountComponent' of null
at ReactCompositeComponentWrapper.performInitialMountWithErrorHandling (ReactCompositeComponent.js:327)
at ReactCompositeComponentWrapper.mountComponent (ReactCompositeComponent.js:256)
at Object.mountComponent (ReactReconciler.js:46)
at ReactCompositeComponentWrapper.performInitialMount (ReactCompositeComponent.js:371)
at ReactCompositeComponentWrapper.mountComponent (ReactCompositeComponent.js:258)
at Object.mountComponent (ReactReconciler.js:46)
at mountComponentIntoNode (ReactMount.js:104)
at ReactReconcileTransaction.perform (Transaction.js:140)
at batchedMountComponentIntoNode (ReactMount.js:126)
at ReactDefaultBatchingStrategyTransaction.perform (Transaction.js:140)
of course, the problem was importing the HOC. Closing since it's not needed anymore