Skip to content

Commit

Permalink
Set @babel/preset-react runtime to automatic and document
Browse files Browse the repository at this point in the history
Auto import needed react/jsx-runtime fn's like React
  • Loading branch information
leotm committed Nov 20, 2021
1 parent 0073560 commit 0e9f212
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,24 @@
*/

module.exports = {
presets: ['module:metro-react-native-babel-preset']
presets: [
'module:metro-react-native-babel-preset',
[
'@babel/preset-react',
{
/**
* runtime: automatic
* - auto imports fn's JSX transpiles to like React
* - adds __source and __self props too for debugging
*/
runtime: 'automatic', // default to classic
/**
* development: true
* - adds __source and __self props too for debugging
* - can't use with runtime: automatic from dupe props errors
* - runtime: classic means no auto imports
*/
}
]
]
}

0 comments on commit 0e9f212

Please sign in to comment.