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