Skip to content

Commit 5796d07

Browse files
author
brentmiller
authored
docs(renderer): consistent return (#382)
Line 102 - removed the block wrapper to fix an "Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`" error. Line 102 - removed reference to index to fix the "'index' is already declared in the upper scope" and "'index' is defined but never used" errors.
1 parent f680b48 commit 5796d07

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

packages/website/docs/creating-a-renderer.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,18 @@ function Autocomplete() {
9999
<section key={`source-${index}`} className="aa-Source">
100100
{items.length > 0 && (
101101
<ul className="aa-List" {...autocomplete.getListProps()}>
102-
{items.map((item, index) => {
103-
return (
104-
<li
105-
key={item.objectID}
106-
className="aa-Item"
107-
{...autocomplete.getItemProps({
108-
item,
109-
source,
110-
})}
111-
>
112-
{item.query}
113-
</li>
114-
);
115-
})}
102+
{items.map((item) => (
103+
<li
104+
key={item.objectID}
105+
className="aa-Item"
106+
{...autocomplete.getItemProps({
107+
item,
108+
source,
109+
})}
110+
>
111+
{item.query}
112+
</li>
113+
))}
116114
</ul>
117115
)}
118116
</section>

0 commit comments

Comments
 (0)