aboutsummaryrefslogtreecommitdiff
path: root/integration/snippets/react-context-value-func.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'integration/snippets/react-context-value-func.tsx')
-rw-r--r--integration/snippets/react-context-value-func.tsx34
1 files changed, 0 insertions, 34 deletions
diff --git a/integration/snippets/react-context-value-func.tsx b/integration/snippets/react-context-value-func.tsx
deleted file mode 100644
index 5f38a5d1c..000000000
--- a/integration/snippets/react-context-value-func.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import React from "react";
-
-const Context = React.createContext({});
-
-const ContextProvider = ({ children }) => {
- const [cb, setCB] = React.useState(function () {});
- const foo = true;
-
- return <Context.Provider value={cb}>{children(foo)}</Context.Provider>;
-};
-
-const ContextValue = ({}) => (
- <Context.Consumer>
- {(foo) => {
- if (foo) {
- return <div>Worked!</div>;
- }
-
- throw `Value "${foo}"" should be true`;
- }}
- </Context.Consumer>
-);
-
-const TestComponent = () => (
- <ContextProvider>
- <ContextValue />
- </ContextProvider>
-);
-
-export function test() {
- const foo = <TestComponent />;
-
- return testDone(import.meta.url);
-}