Skip to content

Commit

Permalink
downgrade react to 18
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberCookie committed Jan 19, 2025
1 parent 11b9be5 commit 58f25d7
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 47 deletions.
2 changes: 1 addition & 1 deletion client_core/ui/DataTable/helpers/apply_virtualization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ function applyVirtualization(params: UseVirtualizationParams) {
maxItemsCount: newMaxItemsCount
})

const rootElement = (rootAttributes.ref as Ref).current
const rootElement = (rootAttributes.ref as Ref).current!
const tableElement = rootElement.firstChild as HTMLTableElement
tableElement.style.padding = `${from * itemHeight}px 0 ${(newMaxItemsCount - to) * itemHeight}px`

Expand Down
6 changes: 3 additions & 3 deletions client_core/ui/Input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const Input = component<Props, DefaultProps>(
inputProps.ref = useRef(null)

autofocus && useEffect(() => {
disabled || (inputProps.ref as InputRef).current.focus()
disabled || (inputProps.ref as InputRef).current!.focus()
}, [ disabled ])
}

Expand Down Expand Up @@ -173,11 +173,11 @@ const Input = component<Props, DefaultProps>(
: value

if (prefix && (selectionStart! < prefix.length)) {
setCaretPos(inputProps.ref! as InputRef, prefix.length)
setCaretPos(inputProps.ref as InputRef, prefix.length)
}

if (suffix && (selectionStart! >= value.length)) {
setCaretPos(inputProps.ref! as InputRef, value.length)
setCaretPos(inputProps.ref as InputRef, value.length)
}
}

Expand Down
2 changes: 1 addition & 1 deletion client_core/ui/Input/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { InputRef } from './types'

const setCaretPos = (ref: InputRef, caretPosFrom: number, caretPosTo?: number) => (
setTimeout(() => {
ref.current.setSelectionRange(caretPosFrom, caretPosTo || caretPosFrom)
ref.current!.setSelectionRange(caretPosFrom, caretPosTo || caretPosFrom)
})
)

Expand Down
4 changes: 2 additions & 2 deletions client_core/ui/Select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const Select = component<Props, DefaultProps>(

onChange(value, e, payload)

closeOnSelect && (selectRootProps.ref as RootRef).current.blur()
closeOnSelect && (selectRootProps.ref as RootRef).current!.blur()
}


Expand Down Expand Up @@ -162,7 +162,7 @@ const Select = component<Props, DefaultProps>(
onMouseDown={ e => {
if (isActive) {
e.preventDefault()
;(selectRootProps.ref as RootRef).current.blur()
;(selectRootProps.ref as RootRef).current!.blur()
}
} }>

Expand Down
2 changes: 1 addition & 1 deletion client_core/ui/_internals/ref_apply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function applyRefApi<
: undefined

useEffect(() => {
getRef((rootProps.ref as React.RefObject<HTMLElement>).current, mergedProps)
getRef((rootProps.ref as React.RefObject<HTMLElement>).current!, mergedProps)
}, trackDependencies)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ const convertSvgToFont: ConvertSvgToFontFn = ({ fontName, svgs, isWoff2 }) => (
})

fontStream.end()
})
)
}))
.then(svgFont => svg2ttf(svgFont, { ts: 0 }).buffer)
.then(ttfFont => isWoff2 ? ttf2woff2(ttfFont as Buffer) : ttf2woff(ttfFont).buffer)

Expand Down
4 changes: 0 additions & 4 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
declare module '*.sass'
// {
// const classes: Record<string, string>
// export default classes
// }



Expand Down
70 changes: 42 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "siegel",
"version": "0.15.6",
"version": "0.15.8",
"homepage": "https://siegel-qe3q.onrender.com",
"url": "https://github.com/CyberCookie/siegel",
"bugs": "https://github.com/CyberCookie/siegel/issues",
Expand Down Expand Up @@ -76,8 +76,8 @@
"mime": "4.0.6",
"mini-css-extract-plugin": "2.9.2",
"postcss-loader": "8.1.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-refresh": "0.16.0",
"sass": "1.83.4",
"sass-loader": "16.0.4",
Expand All @@ -104,8 +104,8 @@
"peerDependencies": {
"@types/express": "4.17.21",
"@types/node": "20.16.9",
"@types/react": "19.0.7",
"@types/react-dom": "19.0.3",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@types/svg2ttf": "5.0.3",
"@types/svgicons2svgfont": "14.0.0",
"@types/ttf2woff": "2.0.4",
Expand Down

0 comments on commit 58f25d7

Please sign in to comment.