Our job now is to separate the description from the reviews using a tab component that we are going to build. We are going to create a simple tab component first and refactor this into the compound component pattern in the next section.
It's time to start on our tab component:
- First, let's create a file called Tabs.tsx for our tab component with the following content in it as a skeleton class component:
import * as React from "react";interface IProps {}interface IState {}class Tabs extends React.Component<IProps, IState> { public constructor(props: IProps) { super(props); this.state = {}; } public render() { return; }}export default Tabs;
We have chosen to create a class-based component because our component ...