Skip to content

Commit

Permalink
fix: Fix default ViewProps
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Feb 19, 2025
1 parent 28f5d59 commit 9f1cfa3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/react-native-nitro-modules/src/views/HybridView.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { HostComponent } from 'react-native'
import type { HostComponent, ViewProps } from 'react-native'
import type { HybridObject } from '../HybridObject'

/**
Expand Down Expand Up @@ -60,7 +60,7 @@ export interface HybridViewMethods {}
/**
* Represents all default props a Nitro HybridView has.
*/
interface DefaultHybridViewProps<Object> {
interface DefaultHybridViewProps<Object> extends ViewProps {
/**
* A `ref` to the {@linkcode HybridObject} this Hybrid View is rendering.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Platform, type ViewProps } from 'react-native'
import { Platform } from 'react-native'
// @ts-expect-error this unfortunately isn't typed or default-exported.
import * as NativeComponentRegistry from 'react-native/Libraries/NativeComponent/NativeComponentRegistry'
import type {
Expand Down Expand Up @@ -35,7 +35,7 @@ export function getHostComponent<
>(
name: string,
getViewConfig: () => ViewConfig<Props>
): HybridView<WrapFunctionsInObjects<Props> & ViewProps, Methods> {
): HybridView<WrapFunctionsInObjects<Props>, Methods> {
if (NativeComponentRegistry == null) {
throw new Error(
`NativeComponentRegistry is not available on ${Platform.OS}!`
Expand Down

0 comments on commit 9f1cfa3

Please sign in to comment.