Skip to content

Commit

Permalink
⬆️ Bump to Next 15 & React 19
Browse files Browse the repository at this point in the history
```
yarn add \
    next@^15 \
    react@^19 \
    react-dom@^19 \
    @types/react@^19 \
    @types/react-dom@^19
yarn add --dev eslint-config-next@^15
yarn upgrade
sed 's/: JSX.Element//' -i src/components/*.tsx
```
  • Loading branch information
AndreMiras committed Dec 9, 2024
1 parent 4de62b9 commit dbbb06c
Show file tree
Hide file tree
Showing 7 changed files with 511 additions and 798 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
"@fortawesome/free-solid-svg-icons": "^6.7.1",
"@fortawesome/react-fontawesome": "^0.2.2",
"@types/node": "^22.10.1",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/react": "^19",
"@types/react-dom": "^19",
"assert": "^2.0.0",
"axios": "^0.26.0",
"bootstrap": "^5.3.3",
"edilkamin": "^1.5.0",
"next": "^14",
"react": "^18",
"next": "^15",
"react": "^19",
"react-bootstrap": "^2.10.6",
"react-dom": "^18",
"react-dom": "^19",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down Expand Up @@ -61,7 +61,7 @@
"@typescript-eslint/eslint-plugin": "^8.17.0",
"@typescript-eslint/parser": "^8.17.0",
"eslint": "^9.16.0",
"eslint-config-next": "^14",
"eslint-config-next": "^15",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-simple-import-sort": "^12.1.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Errors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useContext } from "react";
import { ErrorContext } from "../context/error";
import Error from "./Error";

const Errors = (): JSX.Element => {
const Errors = () => {
const { errors, setErrors } = useContext(ErrorContext);
const removeIndex = (index: number) =>
setErrors(errors.filter((error, i) => i !== index));
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useIsLoggedIn } from "../utils/hooks";
import Login from "./Login";
import Logout from "./Logout";

const Header = (): JSX.Element => (
const Header = () => (
<Navbar bg="dark" variant="dark" expand="sm">
<Container>
<Navbar.Brand href="/">
Expand Down
2 changes: 1 addition & 1 deletion src/components/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { isValidFireplace } from "../utils/helpers";
// In our case fireplaces are added by the user and stored to the localStorage.
const localStorageKey = "fireplaces";

const Home = (): JSX.Element => {
const Home = () => {
const getFireplacesLocalStorage = (): string[] =>
JSON.parse(localStorage.getItem(localStorageKey) || "[]");

Expand Down
2 changes: 1 addition & 1 deletion src/components/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ErrorContext, ErrorType } from "../context/error";
import { TokenContext } from "../context/token";
import { setTokenLocalStorage } from "../utils/helpers";

const Login = (): JSX.Element => {
const Login = () => {
const [username, setUsername] = useState<string>("");
const [password, setPassword] = useState<string>("");
const { setToken } = useContext(TokenContext);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Logout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Button } from "react-bootstrap";

import { useLogout } from "../utils/hooks";

const Logout = (): JSX.Element => {
const Logout = () => {
// TODO: ideally hit the backend to invalidate the token too
const logout = useLogout();
const onLogoutClick = (): void => logout();
Expand Down
1,287 changes: 500 additions & 787 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit dbbb06c

Please sign in to comment.