1// param type return type
2function myFunction(params: string): number {
3 // do some with params (type string)
4 // Return a number
5}
6// Leaving return type out may cause below error:
7// Missing return type on function.eslint(@typescript-eslint/explicit-function-return-type)
8
9// Example with React
10import React from "react"; // or import React, { FC } from "react";
11const Component: React.FC<MyPropType> = (props: MyPropType) => {
12 return <p>Hello, React</p>;
13}