-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathApp.tsx
60 lines (56 loc) · 1.46 KB
/
App.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import React, { useState, useEffect, useRef } from "react"
import TodoList from './TodoList'
import Button from './1_Button_JSDoc_Simple'
import ButtonTwo from './2_Button_JSDoc_TypeDef_Function'
import ButtonClass from './3_Button_JSDoc_TypeDef_Class'
import ButtonImportedTypes from './4_Button_JSDoc_ImportedTypes'
import ButtonReactTypes from './5_Button_JSDoc_ImportedTypes_React'
import List from './6_List_TypeScript'
import Card from './Card'
import Analytics from 'analytics'
import { addListener } from '@analytics/listener-utils'
const analytics = Analytics({
app: 'xyz',
})
console.log('Analytics lib', Analytics)
console.log('analytics instance', analytics)
export default function App() {
const divRef = useRef<HTMLDivElement>(null)
useEffect(() => {
addListener(divRef.current, 'click', () => {
console.log('do thing')
})
})
return (
<div ref={divRef}>
<List message='jejeje' />
<Card>
hi
</Card>
<Button
isActive
style={{ color: 'green' }}
>
Button text
</Button>
<ButtonTwo
textColor='green'
overrideStyles={{ color: 'blue' }}
/>
<ButtonClass
textColor='hi'
/>
<ButtonImportedTypes
message='hello'
count={2}
disabled={true}
/>
<ButtonReactTypes
children1={<strong>bold</strong>}
>
<p>cool</p>
</ButtonReactTypes>
<TodoList />
</div>
)
}