Skip to content

Commit

Permalink
feat(hippy-react-web): fix text-input setStyle error
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdyqin committed Jul 28, 2023
1 parent 4f0ebf9 commit 8dd25bd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/hippy-react-web/src/components/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { isFunc, noop } from '../utils';
type ImageResizeMode = 'cover' | 'contain' | 'stretch' | 'center' | 'none';
export interface ImageProps extends LayoutableProps, TouchableProps, ClickableProps {
[key: string]: any;
style: HippyTypes.ImageStyle | HippyTypes.ImageStyle[];
style: HippyTypes.ImageStyleProp;
tintColor?: HippyTypes.tintColor;
children?: any;
onError?: LoadError;
Expand Down
4 changes: 2 additions & 2 deletions packages/hippy-react-web/src/components/text-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { isFunc } from '../utils';
* @noInheritDoc
*/
export interface TextInputProps extends LayoutableProps, ClickableProps {
style?: HippyTypes.TextStyle | HippyTypes.TextStyle[];
style?: HippyTypes.TextStyleProp;
caretColor?: string;
defaultValue?: string;
editable?: boolean;
Expand Down Expand Up @@ -65,7 +65,7 @@ const TextInput: React.FC<TextInputProps> = React.forwardRef<any, TextInputProps
const copyProps = { ...props };
const setStyle = (property: string, value: any) => {
if (Array.isArray(style)) {
style.push({ property: value });
style.push({ [property]: value });
} else {
style[property] = value;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/hippy-react-web/src/components/text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const styles = {
const TextAncestorContext = createContext(false);

interface TextProps extends LayoutableProps, TouchableProps, ClickableProps {
style?: HippyTypes.TextStyle | HippyTypes.TextStyle[];
style?: HippyTypes.TextStyleProp;
numberOfLines?: number;
opacity?: number;
ellipsizeMode?: 'clip' | 'ellipsis';
Expand Down
2 changes: 1 addition & 1 deletion packages/hippy-react-web/src/components/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ interface ViewProps extends LayoutableProps, TouchableProps, ClickableProps {
ref?: any;
accessible?: boolean;
accessibilityLabel?: string;
style?: HippyTypes.ViewStyle | HippyTypes.ViewStyle[];
style?: HippyTypes.ViewStyleProp;
opacity?: number;
overflow?: 'visible' | 'hidden';
className?: any;
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ let builds = [...reactBuilds, ...reactWebBuilds, ...vueBuilds, ...vueNextBuilds,
// filter builds via command line arg
if (process.argv[2]) {
const filters = process.argv[2].split(',');
builds = builds.filter(b => filters.some(f => b.output.file.indexOf(f) > -1 || b.output.name.indexOf(f) > -1));
builds = builds.filter(b => filters.some(f => b.output.file?.indexOf(f) > -1 || b.output.name?.indexOf(f) > -1));
}

function blue(str) {
Expand Down

0 comments on commit 8dd25bd

Please sign in to comment.