mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Repro for fbt with unexpected child count
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
|
||||
## Input
|
||||
|
||||
```javascript
|
||||
function Component(props) {
|
||||
return (
|
||||
<fbt desc="Title">
|
||||
<fbt:plural count={identity(props.count)} name="count" showCount="yes">
|
||||
vote
|
||||
</fbt:plural>{" "}
|
||||
for <fbt:param name="option">{props.option} </fbt:param>
|
||||
</fbt>
|
||||
);
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
## Error
|
||||
|
||||
```
|
||||
5 | vote
|
||||
6 | </fbt:plural>{" "}
|
||||
> 7 | for <fbt:param name="option">{props.option} </fbt:param>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ReactForget] Invariant: Expected fbt element to have 3 children (whitespace, content, whitespace) or 1 (content) (7:7)
|
||||
8 | </fbt>
|
||||
9 | );
|
||||
10 | }
|
||||
```
|
||||
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
function Component(props) {
|
||||
return (
|
||||
<fbt desc="Title">
|
||||
<fbt:plural count={identity(props.count)} name="count" showCount="yes">
|
||||
vote
|
||||
</fbt:plural>{" "}
|
||||
for <fbt:param name="option">{props.option} </fbt:param>
|
||||
</fbt>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user