Skip to content

Instantly share code, notes, and snippets.

@kenmori
Last active July 2, 2019 10:55
Show Gist options
  • Save kenmori/48cd7f1413596f6556be3bdcd90c6b64 to your computer and use it in GitHub Desktop.
Save kenmori/48cd7f1413596f6556be3bdcd90c6b64 to your computer and use it in GitHub Desktop.
ReactHooks x TypeScript
import React, { useState, useCallback } from "react";

import {
  ExpansionPanel,
  ExpansionPanelSummary,
  ExpansionPanelDetails,
  Typography,
} from "@material-ui/core";
import { ExpandMore as ExpandMoreIcon } from "@material-ui/icons";

import classes from "./classes.css";

export interface StateProps {
  description: string;
}

interface LocalState {
  expanded: boolean;
}

type Props = StateProps;

const OwnAppDescriptionViewer:React.FC<Props> = ({ description }) => {
  const [state, setExpands] = useState<LocalState>({ expanded: false });
  const handleChange = useCallback(() => {
    setExpands((prevState) => ({ expanded: !prevState.expanded }));
    },[setExpands]);
    return (
      <>
        hoge
      </>
    );
  };

export default OwnAppDescriptionViewer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment