Before You Submit
Describe the issue
The ScrollToTop component currently types children as React.ReactNode. This can be simplified by importing ReactNode directly from react and using it in the props type.
Goal:
- Import
ReactNode from react.
- Replace
React.ReactNode with ReactNode in the component props.
Import:
import { ReactNode, useLayoutEffect } from 'react';
Current:
const ScrollToTop = ({ children }: { children: React.ReactNode }) => { ... }
After cleanup:
const ScrollToTop = ({ children }: { children: ReactNode }) => { ... }
Before You Submit
Describe the issue
The ScrollToTop component currently types
childrenasReact.ReactNode. This can be simplified by importingReactNodedirectly fromreactand using it in the props type.Goal:
ReactNodefromreact.React.ReactNodewithReactNodein the component props.Import:
Current:
After cleanup: