ggr247
December 11, 2020, 5:51pm
1
static contextType = ReactReduxContext;
constructor(props, context) {
super(props, context);
this.injectors = getInjectors(context.store);
const sagaName = pluginId ? `${pluginId}_${key}` : key;
console.warn(
'Warning: strapi.injectSaga will be removed in the next major release. \n Please update your code.'
);
this.injectors.injectSaga(sagaName, { saga, mode }, this.props);
}
componentWillUnmount() {
const { ejectSaga } = this.injectors;
const sagaName = pluginId ? `${pluginId}_${key}` : key;
ejectSaga(sagaName);
So strapi.injectSaga() is deprecated, but I still need to use sagas in my custom plugin. Is there a recommended way to achieve the same functionality without using strapi.injectSaga?
1 Like
Hi, I would also like to know the answer to this question.