MCPcopy
hub / github.com/react/react / FooAndBar

Function FooAndBar

packages/react-reconciler/src/__tests__/ReactNewContext-test.js:1083–1092  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1081 const BarContext = React.createContext(0);
1082
1083 function FooAndBar() {
1084 return (
1085 <FooContext.Consumer>
1086 {foo => {
1087 const bar = readContext(BarContext);
1088 return <Text text={`Foo: ${foo}, Bar: ${bar}`} />;
1089 }}
1090 </FooContext.Consumer>
1091 );
1092 }
1093
1094 class Indirection extends React.Component {
1095 shouldComponentUpdate() {

Callers

nothing calls this directly

Calls 1

readContextFunction · 0.70

Tested by

no test coverage detected