Skip to content

Commit

Permalink
Implement reader in class
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Apr 13, 2021
1 parent 99600c8 commit 82bdc8b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/react-server/src/ReactFizzClassComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

import {emptyContextObject} from './ReactFizzContext';
import {readContext} from './ReactFizzNewContext';

import {disableLegacyContext} from 'shared/ReactFeatureFlags';
import {get as getInstance, set as setInstance} from 'shared/ReactInstanceMap';
Expand Down Expand Up @@ -211,9 +212,7 @@ export function constructClassInstance(
}

if (typeof contextType === 'object' && contextType !== null) {
// TODO: Implement Context.
// context = readContext((contextType: any));
throw new Error('Context is not yet implemented.');
context = readContext((contextType: any));
} else if (!disableLegacyContext) {
context = maskedLegacyContext;
}
Expand Down Expand Up @@ -617,9 +616,7 @@ export function mountClassInstance(

const contextType = ctor.contextType;
if (typeof contextType === 'object' && contextType !== null) {
// TODO: Implement Context.
// instance.context = readContext(contextType);
throw new Error('Context is not yet implemented.');
instance.context = readContext(contextType);
} else if (disableLegacyContext) {
instance.context = emptyContextObject;
} else {
Expand Down

0 comments on commit 82bdc8b

Please sign in to comment.