remove React's FC type from codebase (#3527)

* WIP-packages: remove React's FC type from codebase

* remove FC from other directories

* fix build failures

* add types to required packages
This commit is contained in:
Askar
2020-12-10 11:23:29 +01:00
committed by GitHub
parent 2cc444f16c
commit a6a2ca6204
96 changed files with 316 additions and 290 deletions
+5 -5
View File
@@ -81,13 +81,13 @@ import { useApi } from '@backstage/core-api';
_from inline:_
```tsx
const ExampleComponent: FC<{}> = () => ( ... )
const ExampleComponent = () => ( ... )
```
_to block:_
```tsx
const ExampleComponent: FC<{}> = () => {
const ExampleComponent = () => {
return (
...
@@ -135,7 +135,7 @@ changes, let's start by wiping this component clean.
1. Replace everything in the file with the following:
```tsx
import React, { FC } from 'react';
import React from 'react';
import { useAsync } from 'react-use';
import Alert from '@material-ui/lab/Alert';
import {
@@ -147,7 +147,7 @@ import {
import { useApi } from '@backstage/core-api';
import { graphql } from '@octokit/graphql';
const ExampleFetchComponent: FC<{}> = () => {
const ExampleFetchComponent = () => {
return <div>Nothing to see yet</div>;
};
@@ -223,7 +223,7 @@ type DenseTableProps = {
viewer: Viewer;
};
export const DenseTable: FC<DenseTableProps> = ({ viewer }) => {
export const DenseTable = ({ viewer }: DenseTableProps) => {
const columns: TableColumn[] = [
{ title: 'Name', field: 'name' },
{ title: 'Created', field: 'createdAt' },