Skip to content

Fix NoUpdate context#2420

Merged
JoviDeCroock merged 2 commits intomasterfrom
fix-context
Mar 17, 2020
Merged

Fix NoUpdate context#2420
JoviDeCroock merged 2 commits intomasterfrom
fix-context

Conversation

@JoviDeCroock
Copy link
Copy Markdown
Member

@JoviDeCroock JoviDeCroock commented Mar 17, 2020

This seemingly updated properties eagerly so I'm going to double check if we're not making any mistakes in the component instance against this.

Because we haven't called Provider yet it seems to be working with a stale ref to the props, this however is already correct on Component hence why this.props provides us with a correct result.

Fixes: #2419

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 17, 2020

Size Change: +3 B (0%)

Total Size: 38.5 kB

Filename Size Change
dist/preact.js 3.72 kB +2 B (0%)
dist/preact.min.js 3.72 kB +2 B (0%)
dist/preact.module.js 3.73 kB -1 B
ℹ️ View Unchanged
Filename Size Change
compat/dist/compat.js 3.12 kB 0 B
compat/dist/compat.module.js 3.14 kB 0 B
compat/dist/compat.umd.js 3.17 kB 0 B
debug/dist/debug.js 2.98 kB 0 B
debug/dist/debug.module.js 2.96 kB 0 B
debug/dist/debug.umd.js 3.04 kB 0 B
devtools/dist/devtools.js 175 B 0 B
devtools/dist/devtools.module.js 185 B 0 B
devtools/dist/devtools.umd.js 252 B 0 B
dist/preact.umd.js 3.78 kB 0 B
hooks/dist/hooks.js 1.05 kB 0 B
hooks/dist/hooks.module.js 1.08 kB 0 B
hooks/dist/hooks.umd.js 1.13 kB 0 B
test-utils/dist/testUtils.js 390 B 0 B
test-utils/dist/testUtils.module.js 392 B 0 B
test-utils/dist/testUtils.umd.js 469 B 0 B

compressed-size-action

@github-actions
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 99.796% when pulling 9463e1d on fix-context into 6599153 on master.

Copy link
Copy Markdown
Member

@developit developit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. This bug was probably my fault haha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A component that is a child of a PureComponent and uses useContext does not re-render when the context value is set to its initial value

2 participants