-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add NavigationFunctionComponent interface (#6249)
Added NavigationFunctionComponent interface This interface can be used instead of React.FunctionComponent, fixing Typescript Property 'options' does not exist on type 'FunctionComponent<{}>' error when trying to declare static options on a functional component.
- Loading branch information
Elizabeth Martín Campos
authored
Jun 9, 2020
1 parent
469e69f
commit c56630e
Showing
2 changed files
with
9 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react'; | ||
import { NavigationComponentProps } from './NavigationComponentProps'; | ||
import { Options } from './Options'; | ||
|
||
export interface NavigationFunctionComponent<Props = {}> | ||
extends React.FunctionComponent<Props & NavigationComponentProps> { | ||
options?: ((props: Props) => Options) | Options; | ||
} |