Skip to content

Commit

Permalink
fix: Typesの廃止
Browse files Browse the repository at this point in the history
Fixes #160
  • Loading branch information
bicstone committed Dec 15, 2020
1 parent 51f32cf commit d5100b3
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions src/components/sections/Hello.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useEffect, useRef } from 'react';
import React from 'react';
import { graphql, useStaticQuery } from 'gatsby';
import { useI18next } from 'gatsby-plugin-react-i18next';
import Typed, { TypedOptions } from 'typed.js';
import { Typography, Grid, Button, makeStyles } from '@material-ui/core';
import { Breakpoint } from '@material-ui/core/styles/createBreakpoints';
import { BicstoneIcon } from '../';
Expand All @@ -20,24 +19,6 @@ export const Hello: React.FC = () => {
const { t, language } = useI18next();
const width = useBreakPoint();
const BUTTON_SMALL_WIDTH: Breakpoint[] = ['xs'];
const wrapEl = useRef<HTMLSpanElement>(null);
useEffect(() => {
if (wrapEl.current) {
const options: TypedOptions = {
typeSpeed: 60,
showCursor: false,
autoInsertCss: false,
strings: [t('hello.title')],
};
// @see https://github.com/mattboldt/typed.js/pull/461
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Typedの型定義が誤っており、HTMLSpanElementは割当可能
const typed = new Typed(wrapEl.current, options);
return () => {
typed.destroy();
};
}
}, [wrapEl.current]);
const { allContentfulHello }: HelloDataQuery = useStaticQuery(
graphql`
query HelloData {
Expand Down

0 comments on commit d5100b3

Please sign in to comment.