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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import React, { createRef, memo, useState } from 'react';
import React, { useRef, memo, useState } from 'react';
import { connect } from 'react-redux';

import {
Expand Down Expand Up @@ -39,7 +39,7 @@ const ScreenReaderPartitionTableComponent = ({
debug,
}: ScreenReaderPartitionTableProps) => {
const [count, setCount] = useState(1);
const tableRowRef = createRef<HTMLTableRowElement>();
const tableRowRef = useRef<HTMLTableRowElement>(null);
const { tableCaption } = a11ySettings;

const rowLimit = TABLE_PAGINATION * count;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ const getSeriesKnob = (group?: string) => {
};

export const Example = () => {
const ref1 = React.createRef<Chart>();
const ref2 = React.createRef<Chart>();
const ref1 = React.useRef<Chart>(null);
const ref2 = React.useRef<Chart>(null);
const pointerUpdate = (event: PointerEvent) => {
action('onPointerUpdate')(event);
if (ref1.current) {
Expand Down
2 changes: 1 addition & 1 deletion storybook/stories/interactions/17_png_export.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const Example = () => {
/**
* The handler section of this story demonstrates the PNG export functionality
*/
const chartRef: React.RefObject<Chart> = React.createRef();
const chartRef = React.useRef<Chart>(null);
const handler = () => {
if (!chartRef.current) {
return;
Expand Down
4 changes: 2 additions & 2 deletions storybook/stories/interactions/18_null_values.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ const getSeriesKnob = (group?: string) => {
};

export const Example = () => {
const ref1 = React.createRef<Chart>();
const ref2 = React.createRef<Chart>();
const ref1 = React.useRef<Chart>(null);
const ref2 = React.useRef<Chart>(null);
const pointerUpdate = (event: PointerEvent) => {
action('onPointerUpdate')(event);
if (ref1.current) {
Expand Down