Skip to content

Commit

Permalink
Force array destructuring to work in loose mode only for known Hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
EivindArvesen committed Feb 17, 2019
1 parent b13b406 commit 8dc1de4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/babel-preset-react-app/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,18 @@ module.exports = function(api, opts, env) {
// Use loose mode for performance:
// https://github.com/facebook/create-react-app/issues/5602
loose: true,
selectiveLoose: [
'useState',
'useEffect',
'useContext',
'useReducer',
'useCallback',
'useMemo',
'useRef',
'useImperativeHandle',
'useLayoutEffect',
'useDebugValue',
],
},
],
// Turn on legacy decorators for TypeScript files
Expand Down

0 comments on commit 8dc1de4

Please sign in to comment.