In file node_modules/@babel/plugin-transform-typescript/lib/index.js
For a function isImportTypeOnly
add code:
function isImportTypeOnly({
binding,
programPath,
jsxPragma
}) {
for (const path of binding.referencePaths) {
if (!isInType(path)) {
return false;
}
}
+ // Small fix to stop removing `import fbt from 'fbt';`
+ if (binding.identifier.name === 'fbt') {
+ return false;
+ }
if (binding.identifier.name !== jsxPragma) {
return true;
}
// ...
And add postinstall
script to package.json
{
"name": "fbtDemo",
"scripts": {
+ "postinstall": "git checkout -f -- :/node_modules",
"start": "react-native start",
},
}