@fullstory/babel-plugin-react-native
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -347,2 +347,22 @@ "use strict"; | ||
}, | ||
// RN screen selector support | ||
JSXOpeningElement: function JSXOpeningElement(path, state) { | ||
var filename = state.file.opts.filename; | ||
var isReactNavigationFile = filename.includes('node_modules/@react-navigation'); | ||
if (!isReactNavigationFile) { | ||
return; | ||
} | ||
if (!t.isJSXIdentifier(path.node.name)) { | ||
return; | ||
} | ||
// rewrite all `<MaybeScreen />` components. | ||
var isMaybeScreenView = path.node.name.name === 'MaybeScreen'; | ||
// <Screen /> is a bit more generic so we want to be specific here | ||
var isNativeStackView = path.node.name.name === 'Screen' && filename.includes('native-stack/src/views/NativeStackView'); | ||
if (isMaybeScreenView || isNativeStackView) { | ||
path.node.attributes.push(t.jsxAttribute(t.jsxIdentifier('fsAttribute'), t.jsxExpressionContainer(t.objectExpression([t.objectProperty(t.stringLiteral('screen-name'), t.memberExpression(t.identifier('route'), t.identifier('name')))])))); | ||
} | ||
}, | ||
JSXAttribute: function JSXAttribute(path) { | ||
@@ -349,0 +369,0 @@ // disable view optimization for only View component |
{ | ||
"name": "@fullstory/babel-plugin-react-native", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "The official FullStory React Native babel plugin", | ||
@@ -5,0 +5,0 @@ "repository": "git://github.com/fullstorydev/fullstory-babel-plugin-react-native.git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24867
369