The editors use Redux to store their state, and it can be hard to reason about.
Expanding on previous work, state that's used by all the editors (i.e. the app state) should be moved into EditorContext.
Example:
🛑 Old:
const learningContextId = useSelector(selectors.app.learningContextId);
🛑 Very old!
mapStateToProps = (state) => ({
learningContextId: selectors.app.learningContextId(state), ...
🛑 Very old! (no need to pass these as props ("prop drilling"); just get them from context wherever you need them)
VideoSelector.propTypes = {
learningContextId: PropTypes.string.isRequired, ...
✅ New:
const { learningContextid } = useEditorContext();
Note: I'm not sure if everything in the app state is used by more than one editor. So check as you go.
PRs:
The editors use Redux to store their state, and it can be hard to reason about.
Expanding on previous work, state that's used by all the editors (i.e. the
appstate) should be moved intoEditorContext.Example:
🛑 Old:
🛑 Very old!
🛑 Very old! (no need to pass these as props ("prop drilling"); just get them from context wherever you need them)
✅ New:
Note: I'm not sure if everything in the
appstate is used by more than one editor. So check as you go.PRs: