fix typescript weirdness while migrating from material v4
This commit is contained in:
@@ -48,7 +48,7 @@ const useStyles = makeStyles({
|
||||
interface IProps {
|
||||
manga: IMangaCard
|
||||
}
|
||||
const AnimeCard = React.forwardRef((props: IProps, ref) => {
|
||||
const AnimeCard = React.forwardRef<HTMLDivElement, IProps>((props: IProps, ref) => {
|
||||
const {
|
||||
manga: {
|
||||
id, title, thumbnailUrl,
|
||||
@@ -60,7 +60,6 @@ const AnimeCard = React.forwardRef((props: IProps, ref) => {
|
||||
return (
|
||||
<Grid item xs={6} sm={4} md={3} lg={2}>
|
||||
<Link to={`/anime/${id}/`}>
|
||||
{/* @ts-ignore */}
|
||||
<Card className={classes.root} ref={ref}>
|
||||
<CardActionArea>
|
||||
<div className={classes.wrapper}>
|
||||
|
||||
@@ -22,7 +22,7 @@ export default function AnimeGrid(props: IProps) {
|
||||
mangas, message, hasNextPage, lastPageNum, setLastPageNum,
|
||||
} = props;
|
||||
let mapped;
|
||||
const lastManga = useRef<HTMLInputElement>();
|
||||
const lastManga = useRef<HTMLInputElement>(null);
|
||||
|
||||
const scrollHandler = () => {
|
||||
if (lastManga.current) {
|
||||
|
||||
@@ -66,7 +66,7 @@ const truncateText = (str: string, maxLength: number) => {
|
||||
interface IProps {
|
||||
manga: IMangaCard
|
||||
}
|
||||
const MangaCard = React.forwardRef((props: IProps, ref) => {
|
||||
const MangaCard = React.forwardRef<HTMLDivElement, IProps>((props: IProps, ref) => {
|
||||
const {
|
||||
manga: {
|
||||
id, title, thumbnailUrl,
|
||||
@@ -78,7 +78,6 @@ const MangaCard = React.forwardRef((props: IProps, ref) => {
|
||||
return (
|
||||
<Grid item xs={6} sm={4} md={3} lg={2}>
|
||||
<Link to={`/manga/${id}/`}>
|
||||
{/* @ts-ignore */}
|
||||
<Card className={classes.root} ref={ref}>
|
||||
<CardActionArea>
|
||||
<div className={classes.wrapper}>
|
||||
|
||||
@@ -22,7 +22,7 @@ export default function MangaGrid(props: IProps) {
|
||||
mangas, message, hasNextPage, lastPageNum, setLastPageNum,
|
||||
} = props;
|
||||
let mapped;
|
||||
const lastManga = useRef<HTMLInputElement>();
|
||||
const lastManga = useRef<HTMLDivElement>(null);
|
||||
|
||||
const scrollHandler = () => {
|
||||
if (lastManga.current) {
|
||||
|
||||
Reference in New Issue
Block a user