Description
Hi all,
For many of these, I did @ts-ignore.
When I copy the screens from my draftbit project into my local project (can't build it all on draftbit due to needing to run pod install
), I like to change it to typescript. Now this works well most of the time (it's generally possible to deduce what types things are and there are not usually any clashes) but there are some issues:
export declare const Button: import("react").ForwardRefExoticComponent<{} & import("react").RefAttributes<any>>;
is missing style
, title
, disable
and icon
.
for export declare const TextField: import("react").ForwardRefExoticComponent<Omit<{...
, numberOfLines: number;
is not optional.
export declare const Link: import("react").ForwardRefExoticComponent<{} & import("react").RefAttributes<any>>;
is also missing style
and title
.
const [checkboxRowValue, setCheckboxRowValue] = React.useState("");
They're string
instead of boolean
. Maybe was supposed to use parseBoolean? (not @draftbit/ui type problem, but rather generated code problem)
For export declare const CheckboxRow: import("react").ForwardRefExoticComponent<Omit<{
, the labelContainerStyle: import("react-native").StyleProp<import("react-native").ViewStyle>;
is not optional.
For <Stack.Navigator screenOptions={({ navigation }) => ({ cardStyle: { flex: 1 }, headerBackImage: Platform.OS === "android" ? DefaultAndroidBackIcon : null, })} >
it's better to return undefined than null. (not @draftbit/ui type problem, but rather generated code problem)
The linking
in <NavigationContainer theme={{ ...DefaultTheme, colors: { ...DefaultTheme.colors, background: "#FFFFFF", }, }} linking={LinkingConfiguration} >
has a completely different API than the one given by LinkingConfiguration (not @draftbit/ui type problem, but rather generated code and interfacing with outside API problem).
For some reason Palette repeats fields.
For example `error TS1117: An object literal cannot have multiple properties with the same name.
200 textPlaceholder: "rgb(136, 144, 153)",And you go look and there are two
textPlaceholder: "rgb(136, 144, 153)"`. (not @draftbit/ui type problem, but rather generated code problem)