Skip to content

Commit

Permalink
added path prop to SingleList Component
Browse files Browse the repository at this point in the history
  • Loading branch information
sar-mko committed Aug 18, 2024
1 parent 295e5e5 commit 50cc414
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/views/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import './Home.css';
import { SingleList } from '../components';
export function Home({ data, setListPath }) {
export function Home({ data, setListPath, path }) {
return (
<div className="Home">
<p>
Hello from the home (<code>/</code>) page!
</p>
<ul>
{/* insert path as prop later */}
{data &&
data.map((list) => {
return (
<SingleList
key={list.id}
key={crypto.randomUUID()}
name={list.name}
setListPath={setListPath}
path={path}
/>
);
})}
Expand Down
5 changes: 0 additions & 5 deletions src/views/List.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ export function List({ data }) {
data.map((list) => {
return <ListItem key={list.id} name={list.name} />;
})}
{/**
* TODO: write some JavaScript that renders the `data` array
* using the `ListItem` component that's imported at the top
* of this file.
*/}
</ul>
</>
);
Expand Down

0 comments on commit 50cc414

Please sign in to comment.