⬆️(frontend) bump to react 19.0.0
Last version of Blocknotes is compatible with React 19.0.0, it seems even necessary to bump the version of React to 19.0.0. We bump the version of React to 19.0.0 and remove the react packages from renovate list of ignored dependencies.
This commit is contained in:
@@ -60,7 +60,7 @@
|
||||
"@types/lodash": "4.17.16",
|
||||
"@types/luxon": "3.4.2",
|
||||
"@types/node": "*",
|
||||
"@types/react": "18.3.12",
|
||||
"@types/react": "*",
|
||||
"@types/react-dom": "*",
|
||||
"cross-env": "7.0.3",
|
||||
"dotenv": "16.4.7",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ComponentPropsWithRef, ReactHTML } from 'react';
|
||||
import { ComponentPropsWithRef, HTMLElementType } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { CSSProperties, RuleSet } from 'styled-components/dist/types';
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
import { hideEffect, showEffect } from './Effect';
|
||||
|
||||
export interface BoxProps {
|
||||
as?: keyof ReactHTML;
|
||||
as?: HTMLElementType;
|
||||
$align?: CSSProperties['alignItems'];
|
||||
$background?: CSSProperties['background'];
|
||||
$color?: CSSProperties['color'];
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import {
|
||||
CSSProperties,
|
||||
ComponentPropsWithRef,
|
||||
ReactHTML,
|
||||
forwardRef,
|
||||
} from 'react';
|
||||
import { CSSProperties, ComponentPropsWithRef, forwardRef } from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { tokens } from '@/cunningham';
|
||||
@@ -14,10 +9,7 @@ const { sizes } = tokens.themes.default.theme.font;
|
||||
type TextSizes = keyof typeof sizes;
|
||||
|
||||
export interface TextProps extends BoxProps {
|
||||
as?: keyof Pick<
|
||||
ReactHTML,
|
||||
'p' | 'span' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
|
||||
>;
|
||||
as?: 'p' | 'span' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
||||
$elipsis?: boolean;
|
||||
$isMaterialIcon?: boolean;
|
||||
$weight?: CSSProperties['fontWeight'];
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
getFormattingToolbarItems,
|
||||
useDictionary,
|
||||
} from '@blocknote/react';
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import React, { JSX, useCallback, useMemo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { getQuoteFormattingToolbarItems } from '../custom-blocks';
|
||||
@@ -27,7 +27,11 @@ export const BlockNoteToolbar = () => {
|
||||
getQuoteFormattingToolbarItems(t),
|
||||
]);
|
||||
const fileDownloadButtonIndex = toolbarItems.findIndex(
|
||||
(item) => item.key === 'fileDownloadButton',
|
||||
(item) =>
|
||||
typeof item === 'object' &&
|
||||
item !== null &&
|
||||
'key' in item &&
|
||||
(item as { key: string }).key === 'fileDownloadButton',
|
||||
);
|
||||
if (fileDownloadButtonIndex !== -1) {
|
||||
toolbarItems.splice(
|
||||
@@ -43,7 +47,7 @@ export const BlockNoteToolbar = () => {
|
||||
);
|
||||
}
|
||||
|
||||
return toolbarItems;
|
||||
return toolbarItems as JSX.Element[];
|
||||
}, [dict, t]);
|
||||
|
||||
const formattingToolbar = useCallback(() => {
|
||||
|
||||
@@ -66,7 +66,7 @@ const useSaveDoc = (docId: string, doc: Y.Doc, canSave: boolean) => {
|
||||
});
|
||||
}, [doc, docId, updateDoc]);
|
||||
|
||||
const timeout = useRef<NodeJS.Timeout>();
|
||||
const timeout = useRef<NodeJS.Timeout | null>(null);
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
@@ -101,7 +101,10 @@ const useSaveDoc = (docId: string, doc: Y.Doc, canSave: boolean) => {
|
||||
router.events.on('routeChangeStart', onSave);
|
||||
|
||||
return () => {
|
||||
clearTimeout(timeout.current);
|
||||
if (timeout.current) {
|
||||
clearTimeout(timeout.current);
|
||||
}
|
||||
|
||||
removeEventListener('beforeunload', onSave);
|
||||
router.events.off('routeChangeStart', onSave);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user