Skip to content

Commit

Permalink
React 19
Browse files Browse the repository at this point in the history
  • Loading branch information
martpie committed Dec 7, 2024
1 parent 35b84a1 commit 1941066
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 30 deletions.
Binary file modified bun.lockb
Binary file not shown.
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-progress": "^1.1.0",
"@radix-ui/react-slider": "^1.2.1",
"@tanstack/react-query": "^5.62.0",
"@tanstack/react-virtual": "3.10.9",
"@tanstack/react-query": "^5.62.3",
"@tanstack/react-virtual": "3.11.0",
"@tauri-apps/api": "2.1.1",
"@tauri-apps/plugin-dialog": "2.0.1",
"@tauri-apps/plugin-log": "2.0.1",
Expand All @@ -45,26 +45,25 @@
"lodash-es": "^4.17.21",
"nanoid": "^5.0.9",
"normalize.css": "^8.0.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-fontawesome": "^1.7.1",
"react-keybinding-component": "^2.2.0",
"react-router": "^7.0.2",
"semver": "^7.6.3",
"zustand": "^5.0.1"
"zustand": "^5.0.2"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@tauri-apps/cli": "2.1.0",
"@types/bun": "^1.1.14",
"@types/lodash": "^4.17.13",
"@types/lodash-es": "^4.17.12",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.1",
"@types/react-fontawesome": "^1.6.8",
"@types/semver": "^7.5.8",
"@vitejs/plugin-react": "^4.3.4",
"@welldone-software/why-did-you-render": "^8.0.3",
"autoprefixer": "^10.4.20",
"madge": "^8.0.0",
"postcss": "^8.4.49",
Expand All @@ -74,7 +73,7 @@
"postcss-url": "^10.1.3",
"typescript": "^5.7.2",
"typescript-plugin-css-modules": "^5.1.0",
"vite": "^6.0.2",
"vite": "^6.0.3",
"vite-plugin-svgr": "^4.3.0"
},
"trustedDependencies": ["@biomejs/biome", "@parcel/watcher"]
Expand Down
8 changes: 5 additions & 3 deletions src/components/Setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function Description(props: Props) {
}

export function Label(
props: JSX.IntrinsicElements['label'] & {
props: React.LabelHTMLAttributes<HTMLLabelElement> & {
noMargin?: boolean;
htmlFor: string;
},
Expand Down Expand Up @@ -44,7 +44,9 @@ export type InputProps = {
id: string;
};

export function Input(props: JSX.IntrinsicElements['input'] & InputProps) {
export function Input(
props: React.InputHTMLAttributes<HTMLInputElement> & InputProps,
) {
const { label, description, id, ...otherProps } = props;
return (
<div>
Expand All @@ -65,7 +67,7 @@ export function ErrorMessage(props: Props) {
}

export function Select(
props: Props & JSX.IntrinsicElements['select'] & InputProps,
props: Props & React.SelectHTMLAttributes<HTMLSelectElement> & InputProps,
) {
const { label, description, id, ...otherProps } = props;

Expand Down
4 changes: 2 additions & 2 deletions src/elements/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ type Props = {
relevancy?: 'danger';
bSize?: 'small';
block?: boolean;
};
} & React.ButtonHTMLAttributes<HTMLButtonElement>;

export default function Button(props: Props & JSX.IntrinsicElements['button']) {
export default function Button(props: Props) {
const { relevancy, bSize, block, ...rest } = props;

const classes = cx(styles.button, {
Expand Down
6 changes: 4 additions & 2 deletions src/hooks/useScrollRestoration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ const setScrollPosition = debounce(function setScrollPosition(
*
* Except we want to use location.pathname, and not location.key
*/
export function useScrollRestoration(container: React.RefObject<HTMLElement>) {
export function useScrollRestoration(
container: React.RefObject<HTMLElement | null>,
) {
const [init, setInit] = useState(false); // React strick mode is a nightmare
const key = `scroll-position-${useLocation().pathname}`;
const { state } = useNavigation();
const target = container.current;
const target = container?.current;

useEffect(() => {
function onScroll() {
Expand Down
12 changes: 0 additions & 12 deletions src/lib/wdyr.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import './lib/wdyr';

/*
|--------------------------------------------------------------------------
| React and Router
Expand Down

0 comments on commit 1941066

Please sign in to comment.