dillon1000/react
Commit
Browse files Allow context values to be mutated in callbacks
Adds a new type for representing context values, which is transitive. So `useContext(a).b.c` also gets inferred as a context type. This allows us to refine our inference, and allow passing callbacks that modify context where a "frozen" lambda is exepcted.
Changed paths7 files
First-parent comparisoncompiler/packages/babel-plugin-react-forget/src/HIR/Globals.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/HIR/HIR.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/HIR/ObjectShape.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/Inference/AnalyseFunctions.ts ModifiedA compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/useContext-mutable-value.expect.md AddedA compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/useContext-mutable-value.js AddedM compiler/packages/sprout/src/SproutTodoFilter.ts ModifiedPatch
Files changed
Rendering syntax-highlighted changes…