0
我很新,但嘗試學習。我正在使用打字稿處理原生項目。特別是創建權限文件使用鏈接this如何打印使用接口方法創建其他打字稿文件的文件?
我基本上是一個攝像頭和存儲方法和一些關於如何在我的項目
const Permission = require('react-native-permissions')
import React from 'react'
import {
StyleSheet,
TouchableHighlight,
Text,
View,
Alert,
AppState,
Platform,
} from 'react-native'
interface Props extends {
string: []
}
interface PermissionsState extends {
status: {},
}
class Permissions extends React.Component<Props,PermissionsState> {
constructor(props) {
Permission.check([type])
type PermissionStatus = 'granted' | 'denied' |'never_ask_again';
this.state = {
};
}
render() {
return (
render() {
return (
<View>
<View/>
)
}
}
export default new Permissions()
創建接口模塊和我的錯誤開始interface Props extends {
線和錯誤混亂描述是:
接口只能使用可選的類型參數來擴展標識符/限定名稱。 (屬性)字符串:undefined []
一些錯誤大約開始這條線;導出類權限....錯誤的名稱是:類'權限'錯誤地擴展基類'組件'。 屬性'呈現'的類型不兼容。 類型'()=>布爾型'不可分配爲鍵入'()=> false |元件'。 類型'布爾值'不可分配爲鍵入'false |元件'。 –
確保你用'tsx'擴展名來聲明你的代碼。不'ts'。 – Amid
我有其他文件在ts格式,哪個文件是我使用的接口模塊,它的工作流暢。 –