Currently, GitHubEventAction uses an any prop for the payload:
|
interface GitHubEventActionProps { |
|
type: string, |
|
payload: any, |
|
} |
This shouldn't have to be the case, since octokit defines types for all of its request/responses, including the payload of an API hit. The reason I haven't done this yet? It's hard to find!
So, let's:
- find the type, and/or create a TS Union of the relevant types
- simplify the existing code in
GitHubEventAction to use the new type, and avoid unnecessary null / ? checks
Currently,
GitHubEventActionuses ananyprop for the payload:opensource/components/GitHubEventAction.tsx
Lines 5 to 8 in 87b2993
This shouldn't have to be the case, since
octokitdefines types for all of its request/responses, including the payload of an API hit. The reason I haven't done this yet? It's hard to find!So, let's:
GitHubEventActionto use the new type, and avoid unnecessarynull/?checks