فهرست منبع

Use Promise<void> where appropriate

Andrew Swistak 6 سال پیش
والد
کامیت
bb58a70b85

+ 1 - 1
app/javascript/packs/frontend/components/pages/pokemon/index.tsx

@@ -17,7 +17,7 @@ class PokemonIndex extends React.Component<void, State> {
     pokemon: [],
   };
 
-  public async componentDidMount(): Promise<any> {
+  public async componentDidMount(): Promise<void> {
     try {
       const data = await Pokemon.index();
       this.setState({pokemon: data.data});

+ 1 - 1
app/javascript/packs/frontend/components/pages/pokemon/show.tsx

@@ -25,7 +25,7 @@ class PokemonShow extends React.Component<RouteComponentProps<PassedRouteProps>,
     },
   };
 
-  public async componentDidMount(): Promise<any> {
+  public async componentDidMount(): Promise<void> {
     try {
       const data = await Pokemon.get(this.props.match.params.id);
       this.setState({pokemon: data.data});