Skip to content

Commit

Permalink
fix: metro bundler `The 'declare' modifier is only allowed when the..…
Browse files Browse the repository at this point in the history
….` error (#224)
  • Loading branch information
hannojg authored Jul 14, 2024
1 parent e5c32cc commit 9b7cf99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package/src/react/FilamentView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export class FilamentView extends React.PureComponent<FilamentProps> {
* @note Not available in the constructor!
*/
static contextType = FilamentContext
declare context: React.ContextType<typeof FilamentContext>
// @ts-expect-error We can't use the declare keyword here as react-natives metro babel preset isn't able to handle it yet
context!: React.ContextType<typeof FilamentContext>

constructor(props: FilamentProps) {
super(props)
Expand Down

0 comments on commit 9b7cf99

Please sign in to comment.