diff --git a/src/Elements/index.js b/src/Elements/index.js index 2674e91..aa9607b 100644 --- a/src/Elements/index.js +++ b/src/Elements/index.js @@ -17,10 +17,8 @@ const Elements = forwardRef(({ }); const { lib, - factory: - globalFactory, + factory: globalFactory, createFactory, - destroyFactory, } = useEngage(); useImperativeHandle(ref, () => ({ @@ -54,7 +52,6 @@ const Elements = forwardRef(({ const destroy = async () => { await Promise.all(state.elements.map(element => element.destroy())); - destroyFactory(); state.elements = []; }; diff --git a/src/EngageContext/index.js b/src/EngageContext/index.js index 8210129..05e99f1 100644 --- a/src/EngageContext/index.js +++ b/src/EngageContext/index.js @@ -68,14 +68,6 @@ const EngageContext = ({ return factory; }; - const destroyFactory = () => { - if (!state.factory) { - return; - } - - dispatch({ factory: null }); - }; - const commitPageView = () => { if (!state.factory) { return; @@ -94,7 +86,6 @@ const EngageContext = ({ lib: state.lib, factory: state.factory, createFactory, - destroyFactory, commitPageView, }), [state.lib, state.factory]);