How to use the react-native-tscodegen-types.codegenNativeComponent function in react-native-tscodegen-types

To help you get started, we’ve selected a few react-native-tscodegen-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / react-native-tscodegen / packages / RN-TSCodegen-Test / src / inputs / components_failure / PROP_NUMBER_TYPE.ts View on Github external
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
// Automatically generated from components_failure/PROP_NUMBER_TYPE.flow.js
// (/react-native/packages/react-native-codegen/src/parsers/flow/components/__test_fixtures__/failures.js)

import {ViewProps} from 'react-native-tscodegen-types';
import {NativeComponent} from 'react-native-tscodegen-types';
import {codegenNativeComponent} from 'react-native-tscodegen-types';
'use strict';

export type ModuleProps = Readonly;

export default (codegenNativeComponent('Module') as NativeComponent);

github microsoft / react-native-tscodegen / packages / RN-TSCodegen-Test / src / inputs / components_success / PROPS_AND_EVENTS_TYPES_EXPORTED.ts View on Github external
string_optional_key?: string;
      double_optional_value: (ReactNull | Double);
      float_optional_value: (ReactNull | Float);
      int32_optional_both?: (ReactNull | Int32);
    });
  };
}>;

export type ModuleProps = Readonly;
  onBubblingEventDefinedInlineWithPaperName: BubblingEventHandler;
  onDirectEventDefinedInline: DirectEventHandler;
  onDirectEventDefinedInlineWithPaperName: DirectEventHandler;
}>;

export default (codegenNativeComponent('Module') as NativeComponent);
github microsoft / react-native-tscodegen / packages / RN-TSCodegen-Test / src / inputs / components_failure / COMMANDS_DEFINED_INLINE.ts View on Github external
import {ViewProps} from 'react-native-tscodegen-types';
import {NativeComponent} from 'react-native-tscodegen-types';
import {codegenNativeComponent} from 'react-native-tscodegen-types';
import {codegenNativeCommands} from 'react-native-tscodegen-types';
'use strict';

export type ModuleProps = Readonly;

export const Commands = codegenNativeCommands<{
  readonly hotspotUpdate: (ref: React.Ref<'RCTView'>, x: Int32, y: Int32) => void;
}>({
  supportedCommands: ['hotspotUpdate']
});

export default (codegenNativeComponent('Module') as NativeComponent);
github microsoft / react-native-tscodegen / packages / RN-TSCodegen-Test / src / inputs / components_success / PROPS_ALIASED_LOCALLY.ts View on Github external
type DeepSpread = Readonly<{
  otherStringProp: string;
}>;

export type PropsInFile = Readonly;

export type ModuleProps = Readonly;
  localArr: ReadonlyArray;
}>;

export default (codegenNativeComponent('Module') as NativeComponent);
github microsoft / react-native-tscodegen / packages / RN-TSCodegen-Test / src / inputs / components_failure / COMMANDS_DEFINED_MULTIPLE_TIMES.ts View on Github external
interface NativeCommands {
  hotspotUpdate(viewRef: React.Ref<'RCTView'>, x: Int32, y: Int32): void;
}

export type ModuleProps = Readonly;

export const Commands = codegenNativeCommands({
  supportedCommands: ['hotspotUpdate']
});

export const Commands2 = codegenNativeCommands({
  supportedCommands: ['hotspotUpdate']
});

export default (codegenNativeComponent('Module') as NativeComponent);

react-native-tscodegen-types

TypeScript Code Generation for React Native Turbo Module

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis

Similar packages