Skip to content

Commit

Permalink
fix: some types
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyhw committed Nov 18, 2024
1 parent 87c7d81 commit 6eae515
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions cli/src/templates/base/components/Button.tsx.ejs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { forwardRef } from 'react';
import { StyleSheet, Text, TouchableOpacity, TouchableOpacityProps } from 'react-native';
import { StyleSheet, Text, TouchableOpacity, TouchableOpacityProps, View } from 'react-native';

type ButtonProps = {
title?: string;
} & TouchableOpacityProps;

export const Button = forwardRef<TouchableOpacity, ButtonProps>(({ title, ...touchableProps }, ref) => {
export const Button = forwardRef<View, ButtonProps>(({ title, ...touchableProps }, ref) => {
return (
<TouchableOpacity ref={ref} {...touchableProps} style={[styles.button, touchableProps.style]}>
<Text style={styles.buttonText}>{title}</Text>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { forwardRef } from 'react';
import { Text, TouchableOpacity, TouchableOpacityProps } from 'react-native';
import { Text, TouchableOpacity, TouchableOpacityProps, View } from 'react-native';

type ButtonProps = {
title: string;
} & TouchableOpacityProps;

export const Button = forwardRef<TouchableOpacity, ButtonProps>(({ title, ...touchableProps }, ref) => {
export const Button = forwardRef<View, ButtonProps>(({ title, ...touchableProps }, ref) => {
return (
<TouchableOpacity ref={ref} {...touchableProps} className={`${styles.button} ${touchableProps.className}`}>
<Text className={styles.buttonText}>{title}</Text>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { forwardRef } from 'react';
import { StyleSheet, Text, TouchableOpacity, TouchableOpacityProps } from 'react-native';
import { StyleSheet, Text, TouchableOpacity, TouchableOpacityProps, View } from 'react-native';

type ButtonProps = {
title?: string;
} & TouchableOpacityProps;

export const Button = forwardRef<TouchableOpacity, ButtonProps>(({ title, ...touchableProps }, ref) => {
export const Button = forwardRef<View, ButtonProps>(({ title, ...touchableProps }, ref) => {
return (
<TouchableOpacity ref={ref} {...touchableProps} style={[styles.button, touchableProps.style]}>
<Text style={styles.buttonText}>{title}</Text>
Expand Down
2 changes: 1 addition & 1 deletion cli/src/templates/packages/nativewindui/theme/index.ts.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Theme } from '@react-navigation/native';
import { COLORS } from './colors';

const NAV_THEME: { light: Theme; dark: Theme } = {
const NAV_THEME: { light: Partial<Theme>; dark: Partial<Theme> } = {
light: {
dark: false,
colors: {
Expand Down
4 changes: 2 additions & 2 deletions cli/src/templates/packages/restyle/components/Button.tsx.ejs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { forwardRef } from 'react';
import { TouchableOpacity, TouchableOpacityProps } from 'react-native';
import { TouchableOpacity, TouchableOpacityProps, View } from 'react-native';
import { Text, makeStyles } from 'theme';

type ButtonProps = {
title?: string;
} & TouchableOpacityProps;

export const Button = forwardRef<TouchableOpacity, ButtonProps>(({ title, ...touchableProps }, ref) => {
export const Button = forwardRef<View, ButtonProps>(({ title, ...touchableProps }, ref) => {
const styles = useStyles();

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { forwardRef } from 'react';
import { Text, TouchableOpacity, TouchableOpacityProps } from 'react-native';
import { Text, TouchableOpacity, TouchableOpacityProps, View } from 'react-native';
import { useStyles } from 'react-native-unistyles';

type ButtonProps = {
title?: string;
} & TouchableOpacityProps;


export const Button = forwardRef<TouchableOpacity, ButtonProps>(({ title, ...touchableProps }, ref) => {
export const Button = forwardRef<View, ButtonProps>(({ title, ...touchableProps }, ref) => {
const { theme } = useStyles();

return (
Expand Down

0 comments on commit 6eae515

Please sign in to comment.