Skip to content

Commit f35c082

Browse files
committed
AnalyticsClick 추가하기
1 parent 9f1068e commit f35c082

File tree

3 files changed

+3043
-3364
lines changed

3 files changed

+3043
-3364
lines changed

demo/with-nextjs/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"@every-analytics/react-analytics-provider": "file:../..",
1313
"@types/react": "file:../../node_modules/react",
1414
"@types/react-dom": "file:../../node_modules/react-dom",
15-
"amplitude-js": "^8.5.0",
1615
"next": "11.1.0",
1716
"react": "file:../../node_modules/react",
1817
"react-dom": "file:../../node_modules/react-dom"

demo/with-nextjs/src/pages/products/index.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {NextPage} from 'next';
22
import {useRouter} from 'next/dist/client/router';
3+
import {AnalyticsClick} from '../../../../../build';
34
import styles from './index.module.css';
45

56
const ColorPage: NextPage = () => {
@@ -10,9 +11,11 @@ const ColorPage: NextPage = () => {
1011
<>
1112
<h1>{color} fruites</h1>
1213
<ul className={styles.container}>
13-
{getProductsByColor(color).map(_color => (
14-
<li key={_color}>{_color}</li>
15-
))}
14+
{getProductsByColor(color).map(_color => {
15+
<AnalyticsClick key={_color} name="color" params={{_color}}>
16+
<li key={_color}>{_color}</li>
17+
</AnalyticsClick>;
18+
})}
1619
</ul>
1720
</>
1821
);

0 commit comments

Comments
 (0)