mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-12 01:37:40 +02:00
Fix reconciliation page errors by correcting React hook usage
Resolve React Error #310 in the reconciliation page by ensuring proper imports and usage of React hooks like useState and useEffect. Replit-Commit-Author: Agent Replit-Commit-Session-Id: b163d4c0-de5e-4f4e-a9c0-aed4c7049718 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/b163d4c0-de5e-4f4e-a9c0-aed4c7049718/7zljVXI
This commit is contained in:
1 parent
99ef70c4f9
commit
dedcd295dd
5 files changed
+39
-752
No files matched your search
@@ -1,11 +1,11 @@
|
||||
import * as React from "react"
|
||||
import { useState, useEffect } from "react"
|
||||
|
||||
const MOBILE_BREAKPOINT = 768
|
||||
|
||||
export function useIsMobile() {
|
||||
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
|
||||
const [isMobile, setIsMobile] = useState<boolean | undefined>(undefined)
|
||||
|
||||
React.useEffect(() => {
|
||||
useEffect(() => {
|
||||
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
|
||||
const onChange = () => {
|
||||
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from "react"
|
||||
import { useState, useEffect, ReactNode } from "react"
|
||||
|
||||
import type {
|
||||
ToastActionElement,
|
||||
@@ -10,8 +10,8 @@ const TOAST_REMOVE_DELAY = 1000000
|
||||
|
||||
type ToasterToast = ToastProps & {
|
||||
id: string
|
||||
title?: React.ReactNode
|
||||
description?: React.ReactNode
|
||||
title?: ReactNode
|
||||
description?: ReactNode
|
||||
action?: ToastActionElement
|
||||
}
|
||||
|
||||
@@ -169,9 +169,9 @@ function toast({ ...props }: Toast) {
|
||||
}
|
||||
|
||||
function useToast() {
|
||||
const [state, setState] = React.useState<State>(memoryState)
|
||||
const [state, setState] = useState<State>(memoryState)
|
||||
|
||||
React.useEffect(() => {
|
||||
useEffect(() => {
|
||||
listeners.push(setState)
|
||||
return () => {
|
||||
const index = listeners.indexOf(setState)
|
||||
|
||||
Reference in new issue
Block a user