Skip to content

chore: react-19 compatibility #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/react.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: React

on:
push:
branches:
- main
paths:
- react/**
- .github/workflows/react.yaml
pull_request:
branches:
- main
paths:
- react/**
- .github/workflows/react.yaml

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: react

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"

- name: Install dependencies
run: npm ci

- name: Test formatting
run: npm run test:format

- name: Test types
run: npm run test:types
8 changes: 8 additions & 0 deletions react/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dist/
dev/

package-lock.json

.prettierignore
.prettierrc
.DS_Store
36 changes: 36 additions & 0 deletions react/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"parser": "typescript",
"overrides": [
{
"files": "*.scss",
"options": {
"parser": "scss"
}
},
{
"files": "*.json",
"options": {
"parser": "json"
}
},
{
"files": "*.html",
"options": {
"parser": "html"
}
},
{
"files": "*.md",
"options": {
"parser": "markdown"
}
}
]
}
12 changes: 5 additions & 7 deletions react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,10 @@ While the component does not require any account to be used (without any limits)
_Example_

```jsx
import { EmbedPDF } from "@simplepdf/react-embed-pdf";
import { EmbedPDF } from '@simplepdf/react-embed-pdf';

<EmbedPDF companyIdentifier="yourcompany">
<a href="https://cdn.simplepdf.com/simple-pdf/assets/sample.pdf">
Opens sample.pdf
</a>
<a href="https://cdn.simplepdf.com/simple-pdf/assets/sample.pdf">Opens sample.pdf</a>
</EmbedPDF>;
```

Expand Down Expand Up @@ -111,15 +109,15 @@ import { EmbedPDF } from "@simplepdf/react-embed-pdf";
Specify `react-viewer` as `companyIdentifier` to disable the editing features:

```jsx
import { EmbedPDF } from "@simplepdf/react-embed-pdf";
import { EmbedPDF } from '@simplepdf/react-embed-pdf';

// The PDF is displayed using the viewer: all editing features are disabled
<EmbedPDF
<EmbedPDF
companyIdentifier="react-viewer"
mode="inline"
style={{ width: 900, height: 800 }}
documentURL="https://cdn.simplepdf.com/simple-pdf/assets/sample.pdf"
/>
/>;
```

### <a id="available-props"></a>Available props
Expand Down
Loading
Loading