11// Jest Snapshot v1, https://goo.gl/fbAQLP
22
3- exports [` Babel plugin optimize React hooks should support destructuring hooks from imports #2 1` ] = `
3+ exports [` React hook transforms should support destructuring hooks from imports #2 1` ] = `
44"import React from \\ "react\\ ";
55const __reactCreateElement__ = React.createElement;
66const {
@@ -15,7 +15,7 @@ export function MyComponent() {
1515} "
1616` ;
1717
18- exports [` Babel plugin optimize React hooks should support destructuring hooks from imports #3 1` ] = `
18+ exports [` React hook transforms should support destructuring hooks from imports #3 1` ] = `
1919"import React from \\ "react\\ ";
2020const __reactCreateElement__ = React.createElement;
2121const useState = React.useState;
@@ -28,7 +28,7 @@ export function MyComponent() {
2828} "
2929` ;
3030
31- exports [` Babel plugin optimize React hooks should support destructuring hooks from imports #4 1` ] = `
31+ exports [` React hook transforms should support destructuring hooks from imports #4 1` ] = `
3232"import React from \\ "react\\ ";
3333const __reactCreateElement__ = React.createElement;
3434const foo = React.useState;
@@ -41,7 +41,7 @@ export function MyComponent() {
4141} "
4242` ;
4343
44- exports [` Babel plugin optimize React hooks should support destructuring hooks from imports #5 1` ] = `
44+ exports [` React hook transforms should support destructuring hooks from imports #5 1` ] = `
4545"import React from \\ "react\\ ";
4646const __reactCreateElement__ = React.createElement;
4747const {
@@ -56,7 +56,7 @@ export function MyComponent() {
5656} "
5757` ;
5858
59- exports [` Babel plugin optimize React hooks should support destructuring hooks from imports 1` ] = `
59+ exports [` React hook transforms should support destructuring hooks from imports 1` ] = `
6060"import React from \\ "react\\ ";
6161const __reactCreateElement__ = React.createElement;
6262const {
@@ -71,7 +71,7 @@ export function MyComponent() {
7171} "
7272` ;
7373
74- exports [` Babel plugin optimize React hooks should support destructuring hooks from require calls 1` ] = `
74+ exports [` React hook transforms should support destructuring hooks from require calls 1` ] = `
7575"const React = require(\\ "react\\ ");
7676
7777const __reactCreateElement__ = React.createElement;
@@ -87,105 +87,40 @@ export function MyComponent() {
8787} "
8888` ;
8989
90- exports [` Babel plugin optimize React hooks should support transform hook imports 1` ] = `
91- "import React from \\ "react\\ ";
92- const {
90+ exports [` React hook transforms should support hook CJS require with no default 1` ] = `
91+ "const {
9392 useState
94- } = React ;"
93+ } = require( \\ "react \\ ") ;"
9594` ;
9695
97- exports [` Babel plugin optimize React hooks should support transform hook imports with aliasing 1` ] = `
96+ exports [` React hook transforms should support hook imports with aliasing 1` ] = `
9897"import React from \\ "react\\ ";
9998const {
10099 useState : foo
101100} = React;"
102101` ;
103102
104- exports [` React hook transforms should support destructuring hooks from imports #2 1` ] = `
103+ exports [` React hook transforms should support hook imports with no default 1` ] = `
105104"import React from \\ "react\\ ";
106- const __reactCreateElement__ = React.createElement;
107105const {
108106 useState
109- } = React;
110- export function MyComponent() {
111- const _ref_0 = useState (0 );
112-
113- const setCounter = _ref_0 [1 ];
114- const counter = _ref_0 [0 ];
115- return __reactCreateElement__ (\\" div\\ " , null , counter );
116- } "
117- ` ;
118-
119- exports [` React hook transforms should support destructuring hooks from imports #3 1` ] = `
120- "import React from \\ "react\\ ";
121- const __reactCreateElement__ = React.createElement;
122- const useState = React.useState;
123- export function MyComponent() {
124- const _ref_0 = useState (0 );
125-
126- const setCounter = _ref_0 [1 ];
127- const counter = _ref_0 [0 ];
128- return __reactCreateElement__ (\\" div\\ " , null , counter );
129- } "
130- ` ;
131-
132- exports [` React hook transforms should support destructuring hooks from imports #4 1` ] = `
133- "import React from \\ "react\\ ";
134- const __reactCreateElement__ = React.createElement;
135- const foo = React.useState;
136- export function MyComponent() {
137- const _ref_0 = foo (0 );
138-
139- const setCounter = _ref_0 [1 ];
140- const counter = _ref_0 [0 ];
141- return __reactCreateElement__ (\\" div\\ " , null , counter );
142- } "
143- ` ;
144-
145- exports [` React hook transforms should support destructuring hooks from imports #5 1` ] = `
146- "import React from \\ "react\\ ";
147- const __reactCreateElement__ = React.createElement;
148- const {
149- useState : foo
150- } = React;
151- export function MyComponent() {
152- const _ref_0 = foo (0 );
153-
154- const setCounter = _ref_0 [1 ];
155- const counter = _ref_0 [0 ];
156- return __reactCreateElement__ (\\" div\\ " , null , counter );
157- } "
107+ } = React;"
158108` ;
159109
160- exports [` React hook transforms should support destructuring hooks from imports 1` ] = `
110+ exports [` React hook transforms should support mixed hook imports 1` ] = `
161111"import React from \\ "react\\ ";
162- const __reactCreateElement__ = React.createElement ;
112+ import { memo } from \\ "react \\ " ;
163113const {
164114 useState
165- } = React;
166- export function MyComponent() {
167- const _ref_0 = useState (0 );
168-
169- const setCounter = _ref_0 [1 ];
170- const counter = _ref_0 [0 ];
171- return __reactCreateElement__ (\\" div\\ " , null , counter );
172- } "
115+ } = React;"
173116` ;
174117
175- exports [` React hook transforms should support destructuring hooks from require calls 1` ] = `
176- "const React = require(\\ "react\\ ");
177-
178- const __reactCreateElement__ = React.createElement;
118+ exports [` React hook transforms should support mixed hook imports with no default 1` ] = `
119+ "import React from \\ "react\\ ";
179120const {
180121 useState
181122} = React;
182- export function MyComponent() {
183- const _ref_0 = useState (0 );
184-
185- const setCounter = _ref_0 [1 ];
186- const counter = _ref_0 [0 ];
187- return __reactCreateElement__ (\\" div\\ " , null , counter );
188- } "
123+ import { memo } from \\ "react\\ ";"
189124` ;
190125
191126exports [` React hook transforms should support transform hook imports 1` ] = `
@@ -194,17 +129,3 @@ const {
194129 useState
195130} = React;"
196131` ;
197-
198- exports [` React hook transforms should support transform hook imports with aliasing 1` ] = `
199- "import React from \\ "react\\ ";
200- const {
201- useState : foo
202- } = React;"
203- ` ;
204-
205- exports [` React hook transforms should support transform hook imports with no default 1` ] = `
206- "import React from \\ "react\\ ";
207- const {
208- useState
209- } = React;"
210- ` ;
0 commit comments