Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tests: fix test
  • Loading branch information
JoviDeCroock committed Oct 31, 2018
commit 19d561b5c6901eb2327c3619bf0d20e6bb25b873
13 changes: 11 additions & 2 deletions src/getDataFromTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,17 @@ export function walkTree(
child = element.props.children;
} else if (ReactIs.isContextConsumer(element)) {
// A consumer
const { type: { _context: { _currentValue, Provider } } } = (element as any);
let value = _currentValue;
console.dir(element)
const { type: { _currentValue, _context } } = (element as any);
let value;
if (_context) {
value = _context._currentValue;
} else {
value = _currentValue;
}
if (newContext.has((element as any).type.Provider)) {
value = newContext.get((element as any).type.Provider);
}
child = (element as any).props.children(value);
}

Expand Down