-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.tsx
36 lines (31 loc) · 787 Bytes
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { Link } from "@remix-run/react";
import { useOptionalUser } from "~/utils";
const someProps = {
text: "Hello",
};
const array = [1, 2, 3, 4, 5];
export default function Index() {
const user = useOptionalUser();
return (
<main className="relative min-h-screen bg-white sm:flex sm:items-center sm:justify-center">
<MyNewComponent {...someProps} color="red" />
{array.map((item) => (
<MyNewComponent
{...someProps}
key={Math.random().toString()}
color="red"
/>
))}
{/* {array.map((item) => (
<MyNewComponent key={item} color="red" {...someProps} />
))} */}
</main>
);
}
const MyNewComponent = ({ text, color }) => {
return (
<div>
{text}-{color}
</div>
);
};