-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Treat HybridViews differently now - they're type aliases (#552)
* feat: Refactor `HybridView`: props and methods are separate now * Update HybridView.ts * feat: Treat HybridViews differently now - they're type aliases * impl * fix types * fix: Fix default `ViewProps` * fix: Fix getting name of Hybrid View * fix: Prepare props parser before `cloneProps`
- Loading branch information
Showing
20 changed files
with
233 additions
and
63 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
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
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
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
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
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
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
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
13 changes: 11 additions & 2 deletions
13
packages/react-native-nitro-image/src/specs/TestView.nitro.ts
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 |
---|---|---|
@@ -1,6 +1,15 @@ | ||
import type { HybridView } from 'react-native-nitro-modules' | ||
import type { | ||
HybridView, | ||
HybridViewMethods, | ||
HybridViewProps, | ||
} from 'react-native-nitro-modules' | ||
|
||
export interface TestView extends HybridView { | ||
export interface TestViewProps extends HybridViewProps { | ||
isBlue: boolean | ||
someCallback: () => void | ||
} | ||
export interface TestViewMethods extends HybridViewMethods { | ||
someMethod(): void | ||
} | ||
|
||
export type TestView = HybridView<TestViewProps, TestViewMethods> |
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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
import { getHostComponent } from 'react-native-nitro-modules' | ||
import TestViewConfig from '../../nitrogen/generated/shared/json/TestViewConfig.json' | ||
import { type TestView as TestViewProps } from '../specs/TestView.nitro' | ||
import { | ||
type TestViewMethods, | ||
type TestViewProps, | ||
} from '../specs/TestView.nitro' | ||
|
||
/** | ||
* Represents the HybridView `TestView`, which can be rendered as a React Native view. | ||
*/ | ||
export const TestView = getHostComponent<TestViewProps>( | ||
export const TestView = getHostComponent<TestViewProps, TestViewMethods>( | ||
'TestView', | ||
() => TestViewConfig | ||
) |
Oops, something went wrong.