typescript missing return type on function
// param type return type
function myFunction(params: string): number {
// do some with params (type string)
// Return a number
}
// Leaving return type out may cause below error:
// Missing return type on function.eslint(@typescript-eslint/explicit-function-return-type)
// Example with React
import React from "react"; // or import React, { FC } from "react";
const Component: React.FC<MyPropType> = (props: MyPropType) => {
return <p>Hello, React</p>;
}