Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 24 additions & 37 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
Expand Up @@ -69,8 +69,8 @@
"@types/d3-selection": "^3.0.10",
"@types/lodash": "^4.14.177",
"@types/node": "^18.0.0",
"@types/react": "^18.3.28",
"@types/react-dom": "^18.3.7",
"@types/react": "^19.2.16",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.4",
"@vitest/browser-playwright": "^4.0.18",
"@vitest/coverage-v8": "^4.0.18",
Expand All @@ -92,8 +92,8 @@
"npm-run-all": "^4.1.5",
"playwright": "^1.58.2",
"prettier": "^3.2.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"rimraf": "^5.0.5",
"sass": "^1.56.2",
"storybook": "^10.2.0",
Expand All @@ -106,7 +106,7 @@
},
"peerDependencies": {
"@gravity-ui/uikit": "^7.0.0",
"react": "^16.0.0 || ^17.0.0 || ^18.0.0"
"react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
},
"scripts": {
"test": "vitest run --project unit",
Expand Down
2 changes: 1 addition & 1 deletion src/components/ChartKit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type ChartKitComponentProps<T extends ChartKitType> = Omit<ChartKitProps<T>, 'on
};

const ChartKitComponent = <T extends ChartKitType>(props: ChartKitComponentProps<T>) => {
const widgetRef = React.useRef<ChartKitWidgetRef>();
const widgetRef = React.useRef<ChartKitWidgetRef | undefined>(undefined);
const {instanceRef, id: propsId, type, isMobile, renderPluginLoader, ...restProps} = props;

const ckId = React.useMemo(() => getRandomCKId(), []);
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/misc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

export function usePrevious<T>(value: T) {
const ref = React.useRef<T>();
const ref = React.useRef<T | undefined>(undefined);

React.useEffect(() => {
ref.current = value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const ChartStory: React.FC<ChartStoryProps> = (props: ChartStoryProps) =>

const initRef = React.useRef(false);
const [visible, setVisible] = React.useState(Boolean(props.visible));
const chartKitRef = React.useRef<ChartKitRef>();
const chartKitRef = React.useRef<ChartKitRef | undefined>(undefined);

if (!initRef.current) {
if (!props.withoutPlugin) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Story = StoryObj<typeof meta>;
export const PerformanceIssue: Story = {
render: () => {
const [shown, setShown] = React.useState(false);
const chartkitRef = React.useRef<ChartKitRef>();
const chartkitRef = React.useRef<ChartKitRef | undefined>(undefined);

const widgetData = React.useMemo(() => {
const categories = Array.from({length: 5000}).map((_, i) => String(i));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {useElementSize} from './useElementSize';

interface HighchartsReactRefObject {
chart: Highcharts.Chart | null | undefined;
container: React.RefObject<HTMLDivElement | undefined>;
container: React.RefObject<HTMLDivElement | null>;
}

interface HighchartsReactProps {
Expand All @@ -33,7 +33,7 @@ export const HighchartsReact = React.memo(
function HighchartsReact(props, ref) {
const {onRender} = props;
const containerRef = React.useRef<HTMLDivElement | null>(null);
const chartRef = React.useRef<Highcharts.Chart | null>();
const chartRef = React.useRef<Highcharts.Chart | null>(null);
const {width, height} = useElementSize(containerRef);
const performanceMeasure = React.useRef<ReturnType<typeof measurePerformance> | null>(
measurePerformance(),
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/indicator/__stories__/Indicator.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface ChartStoryProps {

const ChartStory = ({color, size, title, nowrap}: ChartStoryProps) => {
const [shown, setShown] = React.useState(false);
const chartkitRef = React.useRef<ChartKitRef>();
const chartkitRef = React.useRef<ChartKitRef | undefined>(undefined);
const resultData = cloneDeep(data);

if (resultData.data) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/yagr/__stories__/Playground.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function prepareData(): YagrWidgetData {

const ChartStory = ({data}: {data: YagrWidgetData}) => {
const [shown, setShown] = React.useState(false);
const chartkitRef = React.useRef<ChartKitRef>();
const chartkitRef = React.useRef<ChartKitRef | undefined>(undefined);

if (!shown) {
settings.set({plugins: [YagrPlugin]});
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/yagr/__stories__/Yagr.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function Tooltip({yagr}: CustomTooltipProps) {
export const Line: Story = {
render: () => {
const [shown, setShown] = React.useState(false);
const chartkitRef = React.useRef<ChartKitRef>();
const chartkitRef = React.useRef<ChartKitRef | undefined>(undefined);

if (!shown) {
settings.set({plugins: [YagrPlugin]});
Expand All @@ -90,7 +90,7 @@ export const Line: Story = {
export const Updates: Story = {
render: () => {
const [shown, setShown] = React.useState(false);
const chartkitRef = React.useRef<ChartKitRef>();
const chartkitRef = React.useRef<ChartKitRef | undefined>(undefined);

const [state, setState] = React.useState(line10);

Expand Down Expand Up @@ -118,7 +118,7 @@ export const Updates: Story = {
export const CustomTooltip: Story = {
render: () => {
const [shown, setShown] = React.useState(false);
const chartkitRef = React.useRef<ChartKitRef>();
const chartkitRef = React.useRef<ChartKitRef | undefined>(undefined);

const [state, setState] = React.useState(line10);

Expand All @@ -145,7 +145,7 @@ export const CustomTooltip: Story = {
export const Area: Story = {
render: () => {
const [shown, setShown] = React.useState(false);
const chartkitRef = React.useRef<ChartKitRef>();
const chartkitRef = React.useRef<ChartKitRef | undefined>(undefined);

if (!shown) {
settings.set({plugins: [YagrPlugin]});
Expand Down
Loading