dillon1000/react

Commit

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.
Browse files
Changed paths7 files
First-parent comparison
M compiler/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 Modified
Patch

Files changed

Rendering syntax-highlighted changes…