Skip to content

Commit

Permalink
fix: Updgrade to React 19
Browse files Browse the repository at this point in the history
  • Loading branch information
dubisdev committed Dec 22, 2024
1 parent 786d17b commit 2b46874
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@
"@tauri-apps/plugin-updater": "2.3.0",
"just-debounce": "1.1.0",
"mathjs": "14.0.1",
"react": "18.3.1",
"react": "19.0.0",
"react-colorful": "5.6.1",
"react-dom": "18.3.1",
"react-dom": "19.0.0",
"react-switch": "7.1.0",
"react-textra": "0.2.0",
"shared-zustand": "2.1.0",
"the-new-css-reset": "1.11.3",
"zustand": "4.5.5"
"zustand": "5.0.2"
},
"devDependencies": {
"@tauri-apps/cli": "2.0.0",
"@types/node": "22.10.2",
"@types/react": "18.3.11",
"@types/react-dom": "18.3.0",
"@types/react": "19.0.2",
"@types/react-dom": "19.0.2",
"@vitejs/plugin-react": "4.3.4",
"typescript": "5.7.2",
"vite": "6.0.5"
Expand Down
4 changes: 3 additions & 1 deletion src/components/ConsoleInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { InputPlaceholder } from "./InputPlaceholder";

export const ConsoleInput = () => {
const { getHistoryActionResult, isHistoryAction } = useHistory();
const [input, setInput] = useCalculatorStore((s) => [s.input, s.setInput]);

const input = useCalculatorStore((s) => s.input);
const setInput = useCalculatorStore((s) => s.setInput);

const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setInput(e.target.value);
Expand Down
3 changes: 2 additions & 1 deletion src/components/Settings/BGColor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import "./bgcolor.css";
import { useSettingsStore } from "@state/settings";

export const BGColor = () => {
const [backgroundColor, setBackgroundColor] = useSettingsStore(s => [s.backgroundColor, s.setBackgrounColor]);
const backgroundColor = useSettingsStore((s) => s.backgroundColor);
const setBackgroundColor = useSettingsStore((s) => s.setBackgrounColor);

const handlePickerChange = (color: string) => {
setBackgroundColor(color);
Expand Down
2 changes: 1 addition & 1 deletion src/state/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const useSettingsStore = create<SettingsState>()(

if ("BroadcastChannel" in globalThis) {
for (const key in defaultSettings) {
share(key, useSettingsStore);
share(key as keyof RunmathSettings, useSettingsStore);
}
}

Expand Down

0 comments on commit 2b46874

Please sign in to comment.