Skip to content

Commit

Permalink
fix(types): add comments for ignoring ts errors, and fix a ts error w…
Browse files Browse the repository at this point in the history
…ith Type assertion
  • Loading branch information
Karthik-B-06 committed Mar 26, 2024
1 parent 452cf1c commit a931de3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/components/checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ const RNCheckbox: React.FC<Partial<CheckboxProps>> = forwardRef<
),
),
// - Web only - Checkbox toggle on Spacebar Press
/**
* * The TypeScript error arises due to an inconsistency between the expected ViewStyle type
* * and the specific styling provided for the web platform,
* * which includes outline and boxShadow properties not defined in the ViewStyle type.
*/
// @ts-ignore
isFocussed && !hasOnlyLabel
? Platform.select({
web: {
Expand Down
6 changes: 6 additions & 0 deletions src/components/radio/Radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ const RNRadio: React.FC<Partial<RadioProps>> = forwardRef<
: "",
),
),
/**
* * The TypeScript error arises due to an inconsistency between the expected ViewStyle type
* * and the specific styling provided for the web platform,
* * which includes outline and boxShadow properties not defined in the ViewStyle type.
*/
// @ts-ignore
isFocussed && !hasOnlyLabel
? Platform.select({
web: {
Expand Down
6 changes: 6 additions & 0 deletions src/components/select/SelectOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ const RNSelectOption: React.FC<SelectOptionProps> = forwardRef<
: "",
),
),
/**
* * The TypeScript error arises due to an inconsistency between the expected ViewStyle type
* * and the specific styling provided for the web platform,
* * which includes outline and boxShadow properties not defined in the ViewStyle type.
*/
// @ts-ignore
isFocussed && !hasOnlyLabel
? Platform.select({
web: {
Expand Down
12 changes: 10 additions & 2 deletions src/components/text-area/TextArea.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { forwardRef, useMemo, useRef, useState } from "react";
import { Platform, TextInputProps } from "react-native";
import { Platform, TextInputProps, TextStyleAndroid } from "react-native";

import { Box, BoxProps, RNTextInput, TouchableProps } from "../../primitives";
import { getTextFontFamily, useTailwind, useTheme } from "../../theme";
Expand Down Expand Up @@ -236,6 +236,12 @@ const RNTextArea: React.FC<Partial<TextAreaProps>> = forwardRef<
),
),
getTextFontFamily(textAreaTheme.size[size]?.base?.default),
/**
* * The TypeScript error arises due to an inconsistency between the expected ViewStyle type
* * and the specific styling provided for the web platform,
* * which includes outline and boxShadow properties not defined in the ViewStyle type.
*/
// @ts-ignore
isFocussedWeb.value
? Platform.select({
web: {
Expand All @@ -251,7 +257,9 @@ const RNTextArea: React.FC<Partial<TextAreaProps>> = forwardRef<
},
})
: {},
Platform.OS === "android" ? textAreaTheme.android : {},
Platform.OS === "android"
? (textAreaTheme.android as TextStyleAndroid)
: {},
styleAdapter(textInputStyle),
]}
multiline={true}
Expand Down

0 comments on commit a931de3

Please sign in to comment.