Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
[ghstack-poisoned]
  • Loading branch information
poteto committed Jul 25, 2024
1 parent dfb94c0 commit a2c4853
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
## Input

```javascript
function Component(props) {
return <View {...props} />;
}

const View = React.memo(({items}) => {
return (
<ul>
Expand All @@ -12,31 +16,47 @@ const View = React.memo(({items}) => {
);
});

export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [
{
items: [
{id: 2, name: 'foo'},
{id: 3, name: 'bar'},
],
},
],
};

```


## Error

```
> 1 | const View = React.memo(({items}) => {
3 | }
4 |
> 5 | const View = React.memo(({items}) => {
| ^^^^^^^^^^^^^^
> 2 | return (
> 6 | return (
| ^^^^^^^^^^
> 3 | <ul>
> 7 | <ul>
| ^^^^^^^^^^
> 4 | {items.map(item => (
> 8 | {items.map(item => (
| ^^^^^^^^^^
> 5 | <li key={item.id}>{item.name}</li>
> 9 | <li key={item.id}>{item.name}</li>
| ^^^^^^^^^^
> 6 | ))}
> 10 | ))}
| ^^^^^^^^^^
> 7 | </ul>
> 11 | </ul>
| ^^^^^^^^^^
> 8 | );
> 12 | );
| ^^^^^^^^^^
> 9 | });
| ^^ Invariant: Expected a variable declarator parent (1:9)
10 |
> 13 | });
| ^^ Invariant: Expected a variable declarator parent (5:13)
14 |
15 | export const FIXTURE_ENTRYPOINT = {
16 | fn: Component,
```
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
function Component(props) {
return <View {...props} />;
}

const View = React.memo(({items}) => {
return (
<ul>
Expand All @@ -7,3 +11,15 @@ const View = React.memo(({items}) => {
</ul>
);
});

export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [
{
items: [
{id: 2, name: 'foo'},
{id: 3, name: 'bar'},
],
},
],
};

0 comments on commit a2c4853

Please sign in to comment.