From 13f3fcdcd0da63e51c3102c99f889d8a8884380e Mon Sep 17 00:00:00 2001 From: Jacob Hartmann Date: Tue, 27 Jun 2023 00:34:09 +0200 Subject: [PATCH] updated simpler task 3 --- src/3/index.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/3/index.tsx b/src/3/index.tsx index e312bc1..70f9f4a 100644 --- a/src/3/index.tsx +++ b/src/3/index.tsx @@ -18,6 +18,15 @@ const filterDown = (filter: string) => (word: string) => String(word).includes(f const filterItems = (items: any, filter: any) => items.filter(filterDown(filter)); const mapItems = (filteredItems: any) => filteredItems.map((item: string) => ); +function ListComponentAlternative(props: any) { + + const mappedItems = props.items + .filter((item: string) => String(item).includes(props.filter)) + .map((item: string) => ); + return
    + {mappedItems} +
+} const Task3: FunctionComponent = () => { const [inputValue, setInputValue] = useState("");