Skip to content

Commit a8126ef

Browse files
committedOct 10, 2023
Update supports
1 parent 3cd71b5 commit a8126ef

File tree

1 file changed

+18
-0
lines changed
  • supports/create-next-app/src/app

1 file changed

+18
-0
lines changed
 

‎supports/create-next-app/src/app/page.tsx

+18
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
useCSVReader,
77
lightenDarkenColor,
88
formatFileSize,
9+
useCSVDownloader,
910
} from 'react-papaparse'
1011

1112
const GREY = '#CCC'
@@ -83,6 +84,7 @@ const styles = {
8384

8485
export default function Home() {
8586
const { CSVReader } = useCSVReader()
87+
const { CSVDownloader } = useCSVDownloader()
8688
const [zoneHover, setZoneHover] = useState(false)
8789
const [removeHoverColor, setRemoveHoverColor] = useState(
8890
DEFAULT_REMOVE_HOVER_COLOR
@@ -157,6 +159,22 @@ export default function Home() {
157159
</>
158160
)}
159161
</CSVReader>
162+
163+
<CSVDownloader
164+
filename={'filename'}
165+
data={() => {
166+
return [
167+
{
168+
"Column 1": "1-1",
169+
"Column 2": "1-2",
170+
"Column 3": "1-3",
171+
"Column 4": "1-4",
172+
}
173+
]}
174+
}
175+
>
176+
Download
177+
</CSVDownloader>
160178
</main>
161179
)
162180
}

0 commit comments

Comments
 (0)