flowtype

    0熱度

    2回答

    我很難描述函數參數的類型,它可以是成功的,也可以是錯誤api響應。這裏的問題是(在this address在TryFlow再現) 該函數可以採取任一個成功響應的對象或錯誤響應對象的簡單令人費解的例子: export type ErrorResponse = { error: { message: string, } } export type SuccessResponse =

    0熱度

    1回答

    是定義原型的正確方法反應原生?我正在尋找一些指導方針。 // @flow import React from 'react'; import { TouchableOpacity, Image, StyleSheet } from 'react-native'; type Props = { style?: StyleSheet.Styles, onPress:()

    3熱度

    1回答

    有人能解釋我: 當我創造新的陣營本地項目,react-native init它也產生.flowconfig 它也同時在流動添加依賴? 使用Visual Studio代碼時,它提供了一些intellisense功能,但我沒有安裝TypeScript或任何東西。如果我想使用TypeScript而不是Flow,我還需要額外安裝TypeScript嗎? 我只是感到困惑,因爲在我的項目目錄中,我有.flow

    0熱度

    1回答

    使用流動型與終極版一起,我有一個類型是這樣的: export type MapState = { addresses: Address[], selected: Array<number> } 和動作創作者: export const setParams = (params: any): Action => { return { type: actionType

    1熱度

    1回答

    您可以在flow.org/try查看代碼,或者你可以看它在這裏: /* @flow */ type Thing = { arr?: Array<number> } const thing: Thing = { arr: [10, 20, 30] } function getSubArray(thing: Thing, index: number) {

    0熱度

    1回答

    早上好, 今天,我在使用基本流定義和擴展基本定義的兩種類型時遇到了問題。 有一個數組,其中每個元素可以匹配First或Second類型定義。當循環這個數組時,我只想處理匹配First類型定義的元素,所以我認爲應該通過檢查僅存在於First的定義中的屬性來完成,並且如果此屬性不存在,則應該跳過此元素。 但是,我不明白對屬性的檢查是否也告訴流,現在可以訪問此屬性。 我做了flow.org一個小的腳本,

    0熱度

    1回答

    流式類型的libdefs是否爲react-router-native過期? 當flow荷蘭國際集團這個工作代碼,我得到: 3: import { Route, Switch, Redirect } from 'react-router-native'; ^^^^^ Named import from module `react-router-native`. This module

    0熱度

    2回答

    在下面的示例中(或在flow.org/try上),當我們通過另一個變量檢查​​null/undefined時,類型細化似乎不起作用。 type Position = {| x: number, y: number |} function anotherCondition(): bool{ return true; } function getIt(): ?

    1熱度

    2回答

    如果在我的代碼,這個簡單的SectionList定義: const s = ( <SectionList renderItem={({ item }) => <Text>abc</Text>} renderSectionHeader={({ section }) => <Text>abc</Text>} sections={[{ data: [1, 2, 3]

    0熱度

    1回答

    我是新來的Facebook流量。 https://github.com/facebook/flow 目前,我有一類這樣的事情,我不喜歡我在構造函數的參數爲​​長。 class SamplePerson { constructor(obj: {id: string, name: string, age: number, height: number, birthdate: string,