Skip to content

Commit

Permalink
feat: added chapter on nextjs
Browse files Browse the repository at this point in the history
  • Loading branch information
egordidenko committed Sep 25, 2024
1 parent 42e956f commit d9d3b2a
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions packages/react-uploader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ React principles.
* [Styles](#styles)
* [File Uploader API](#file-uploader-api)
* [Events](#events)
* [Next.js](#nextjs)
* [Security issues](#security-issues)
* [Feedback](#feedback)

Expand Down Expand Up @@ -120,8 +121,7 @@ import {
import "@uploadcare/react-uploader/core.css";

const Example = () => {
const uploaderRef = useRef < InstanceType < UploadCtxProvider > | null > (null);

const uploaderRef = useRef <InstanceType<UploadCtxProvider> | null>(null);

<FileUploaderRegular apiRef={uploaderRef} pubkey="YOUR_PUBLIC_KEY"/>;
}
Expand Down Expand Up @@ -172,6 +172,21 @@ import "@uploadcare/react-uploader/core.css";
| change | onChange |
| group-created | onGroupCreated |

## Next.js
File Uploader does not support Server-side Rendering (SSR), we have a special import for nextjs that already has SSR disabled.
You will need to import with import `@uploadcare/react-uploader/next`

```jsx
'use client'
import { FileUploaderRegular } from "@uploadcare/react-uploader/next";
import "@uploadcare/react-uploader/core.css";

function App() {
return <FileUploaderRegular pubkey="FileUploaderRegular" />
};
```


## Security issues

If you think you ran into something in Uploadcare libraries that might have
Expand Down

0 comments on commit d9d3b2a

Please sign in to comment.