Skip to content
Open
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
5,932 changes: 0 additions & 5,932 deletions examples/js/nextjs/package-lock.json

This file was deleted.

18,239 changes: 0 additions & 18,239 deletions examples/js/react/package-lock.json

This file was deleted.

32 changes: 19 additions & 13 deletions examples/js/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@bugsnag/js": "^7.0.0",
"@bugsnag/plugin-react": "^7.0.0",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"react-scripts": "2.1.1",
"serve": "^11.3.0"
"@bugsnag/js": "^8.0.0",
"@bugsnag/plugin-react": "^8.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-scripts": "5.0.1",
"serve": "^14.2.4"
},
"scripts": {
"start": "react-scripts start",
Expand All @@ -20,10 +20,16 @@
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
2 changes: 1 addition & 1 deletion examples/js/react/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ class App extends Component {
}
}

export default App
export default App
2 changes: 1 addition & 1 deletion examples/js/react/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ ReactDOM.render(
<App />
</ErrorBoundary>,
document.getElementById('root')
)
)
8 changes: 8 additions & 0 deletions examples/ts/react-v19/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
build
.git
.gitignore
Dockerfile
README.md
.env
*.log
24 changes: 24 additions & 0 deletions examples/ts/react-v19/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.env

npm-debug.log*
yarn-debug.log*
yarn-error.log*
11 changes: 11 additions & 0 deletions examples/ts/react-v19/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:25-alpine3.21

WORKDIR /app

COPY package*.json .

RUN npm install

COPY . .

CMD ["npm", "start"]
38 changes: 38 additions & 0 deletions examples/ts/react-v19/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# React

This is an example project showing how to use `@bugsnag/js` with a React project.

This project was bootstrapped with [`create-react-app`](https://github.com/facebook/create-react-app).

## Usage

Clone the repo and `cd` into the directory of this example:

```
git clone [email protected]:bugsnag/bugsnag-js.git --recursive
cd bugsnag-js/examples/ts/react-v19
```
Take a look at...:
- [`src/App.tsx`](src/App.tsx) to see how to setup Bugsnag once for your application and how the `ErrorBoundary` is used and to see how the errors are triggered
- [`src/components/ErrorActionButtons.tsx](src/components/ErrorActionButtons.tsx) to see how errors are triggered

### With docker

The project includes a `Dockerfile`. If you're familiar with docker, this is the easiest way to start the example. Otherwise, skip ahead to the [without docker](#without-docker) section.

```
docker build -t bugsnag-ts-example-react . && \
docker run -p 5000:5000 -it bugsnag-ts-example-react
```

__Note__: remember to replace `YOUR_API_KEY` in `src/lib/bugsnag.js` with your own!

### Without docker

Ensure you have a version of Node.js >=4 on your machine.

```
npm install
npm run start
```
__Note__: remember to replace `YOUR_API_KEY` in `src/index.js` with your own!
Loading