JSX Support short bool syntax
See original GitHub issueFor next example
<fbt desc="" doNotExtract>Test</fbt>
I get this error:
TypeError: Cannot read property 'type' of null
at node_modules/babel-plugin-fbt/FbtUtil.js:140:15
at Array.forEach (<anonymous>)
at getOptionsFromAttributes (node_modules/babel-plugin-fbt/FbtUtil.js:130:18)
at PluginPass.JSXElement (node_modules/babel-plugin-fbt/index.js:153:13)
at newFn (node_modules/@babel/traverse/lib/visitors.js:193:21)
at NodePath._call (node_modules/@babel/traverse/lib/path/context.js:53:20)
at NodePath.call (node_modules/@babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (node_modules/@babel/traverse/lib/path/context.js:88:12)
at TraversalContext.visitQueue (node_modules/@babel/traverse/lib/context.js:118:16)
at TraversalContext.visitSingle (node_modules/@babel/traverse/lib/context.js:90:19)
// this example work fine
<fbt desc="" doNotExtract={true}>Test</fbt>
{
"babel-plugin-fbt": "^0.9.14",
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
JSX In Depth - React
Fundamentally, JSX just provides syntactic sugar for the React. ... the ES6 object shorthand {foo} which is short for {foo: foo} rather than...
Read more >How are boolean props used in React? - Stack Overflow
Passing a boolean variable/expression in JSX: ... Are both acceptable? Referring to the way of passing an explicit true vs defaulting a prop...
Read more >Negated Boolean Prop Shorthand #50 - reactjs/rfcs - GitHub
JSX has a shorthand boolean prop notation, which sets prop to true. Click me! But this feature allows to set props only to...
Read more >Logical OR (||) - JavaScript - MDN Web Docs - Mozilla
It is typically used with boolean (logical) values. ... Short circuit means that the expr part above is not evaluated, hence any side ......
Read more >7 Ways to Implement Conditional Rendering in React ...
In JSX, you are able to use JavaScript code with markup to render dynamic values within your application. JSX uses curly braces (...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK, you are clear for takeoff 😃 https://github.com/facebookincubator/fbt/issues/84
Try running
yarn test
from the top-level repo after rebasingI’d recommend adding some tests using your new syntax similar to: https://github.com/facebookincubator/fbt/blob/9963128994dadbf1f8c362ee13e313f66787df0e/packages/babel-plugin-fbt/__tests__/fbtJsx-test.js#L870-L881
https://github.com/facebookincubator/fbt/commit/8ba8802f3897b1f984ae56c85fe631e0a7c845a2