Hi
i’m currently trying the remix-cars-service App, but the app-extensions-sdk is causing problems. Everything works in the original version. After updating Remix to V.2+ and the app-extensions-sdk to 0.10.1, I get the following error message:
TypeError: AppExtensionsSDK is not a constructor
Code:
import React, { useState, createContext, useEffect } from 'react';
import PropTypes from 'prop-types';
import AppExtensionsSDK from '@pipedrive/app-extensions-sdk';
const SdkContext = createContext({ sdk: null });
const SdkContextProvider = ({ id, children }) => {
const [sdk, setSdk] = useState(null);
useEffect(() => {
console.log("Creating new Sdk-Init! [id: %s]", id)
const initialize = async () => {
console.log(AppExtensionsSDK)
const sdk = await new AppExtensionsSDK().initialize();
setSdk(sdk);
}
initialize().catch(console.error);
}, [id]);
return (
<SdkContext.Provider value={sdk}>
{children}
</SdkContext.Provider>
);
};
SdkContextProvider.propTypes = {
children: PropTypes.node.isRequired,
};
export { SdkContext, SdkContextProvider };
Does anyone know what I’m doing wrong?
Thanks in advance!