This fix (https://github.com/GeekyAnts/NativeBase/issues/960) has been removed in current version of index.d.ts for native base 2.12.1. Name is no longer optional. According to documentation Icon can be used without name but with android and ios properties.
Following is copy of documentation example of Icon:
`import React, { Component } from 'react';
import { Container, Header, Content, Icon } from 'native-base';
export default class IconExample extends Component {
render() {
return (
);
}
}`
lines 642-653 of index.t.ts
interface Icon extends Testable { name: string; type?: "AntDesign" | "Entypo" | "EvilIcons" | "Feather" | "FontAwesome" | "FontAwesome5" | "Foundation" | "Ionicons" | "MaterialCommunityIcons" | "MaterialIcons" | "Octicons" | "SimpleLineIcons" | "Zocial"; // TODO position attribute of ReactNative.FlexStyle hasn't another position values without "absolute" and "relative" style?: any; onPress?: (e?: any) => any; active?: boolean; ios?: string; android?: string; color?: string; fontSize?: number; }
Example usage that triggers 'Property 'name' is missing in type...' error in Typescript: <Icon active ios='ios-send' android='md-send />
node, npm, react-native, react and native-base version, expo version if used, xcode version
irrelevant
Expected behaviour
Typescript does not complain about only using ios and android properties of Icon.
Actual behaviour
Typescript complains that attribute name is missing
Steps to reproduce
-use Typescript and Icon with only ios and android attributes without name defined
Is the bug present in both iOS and Android or in any one of them?
Irrelevant
Any other additional info which would help us debug the issue quicker.
I have gone through these following points
Issue Description
This fix (https://github.com/GeekyAnts/NativeBase/issues/960) has been removed in current version of index.d.ts for native base 2.12.1. Name is no longer optional. According to documentation Icon can be used without name but with android and ios properties.
Following is copy of documentation example of Icon:
`import React, { Component } from 'react'; import { Container, Header, Content, Icon } from 'native-base'; export default class IconExample extends Component { render() { return (
} }`
lines 642-653 of index.t.ts
interface Icon extends Testable { name: string; type?: "AntDesign" | "Entypo" | "EvilIcons" | "Feather" | "FontAwesome" | "FontAwesome5" | "Foundation" | "Ionicons" | "MaterialCommunityIcons" | "MaterialIcons" | "Octicons" | "SimpleLineIcons" | "Zocial"; // TODO position attribute of ReactNative.FlexStyle hasn't another position values without "absolute" and "relative" style?: any; onPress?: (e?: any) => any; active?: boolean; ios?: string; android?: string; color?: string; fontSize?: number; }
Example usage that triggers 'Property 'name' is missing in type...' error in Typescript: <Icon active ios='ios-send' android='md-send />
node, npm, react-native, react and native-base version, expo version if used, xcode version
irrelevant
Expected behaviour
Typescript does not complain about only using ios and android properties of Icon.
Actual behaviour
Typescript complains that attribute name is missing
Steps to reproduce
-use Typescript and Icon with only ios and android attributes without name defined
Is the bug present in both iOS and Android or in any one of them?
Irrelevant
Any other additional info which would help us debug the issue quicker.