小编Sha*_*kim的帖子

如何防止平面列表页眉或页脚在反应中重新呈现

我在 flatlist 的页脚中放置了一个输入字段,但是当我尝试输入任何内容时,它会自动关闭键盘,因为重新渲染了 flatlist 页脚。

我试图从 Scrollview 嵌套 flatlist 但这带来了警告..

如何阻止页脚被重新渲染?我可以在不嵌套 Scrollview 的 flatlist 的情况下解决这个问题吗?

<FlatList
              ListHeaderComponent={() => (
                <View style={styles.discountContainer}>
                  <Text style={[styles.buttonText, { letterSpacing: 3 }]}>
                    10% DISCOUNT ON 8 COURSES
                  </Text>
                </View>
              )}
              numColumns={2}
              data={data}
              renderItem={({ item }) => (
                <View>
                  <SingleProduct item={item} />
                </View>
              )}
              ListFooterComponent={() => (
                <View>
                  <View style={styles.couponContainer}>
                    <Input
                      placeholder='Coupon code'
                      placeholderTextColor='#0a5796'
                      color='#0a5796'
                      inputStyle={{
                        color: '#0a5796',
                      }}
                      inputContainerStyle={{
                        borderBottomWidth: 0,
                        height: 50,
                      }}
                      containerStyle={styles.couponInputContainer}
                      onChangeText={(value) =>
                        this.setState({ couponCode: value })
                      }
                      value={this.state.couponCode}
                    />
                    {couponLoading …
Run Code Online (Sandbox Code Playgroud)

footer rerender react-native react-native-flatlist

8
推荐指数
2
解决办法
2536
查看次数

如何从React Native WebView中的URL GET参数中获取值?

我有这样的回应

\n\n
webViewState Object {\n  "canGoBack": true,\n  "canGoForward": false,\n  "loading": false,\n  "navigationType": "other",\n  "target": 65507,\n  "title": "\xd8\xa7\xd9\x84\xd8\xb3\xd8\xaf\xd8\xa7\xd8\xaf \xd8\xa8\xd9\x88\xd8\xa7\xd8\xb3\xd8\xb7\xd8\xa9 PayPal - \xd8\xb1\xd8\xa7\xd8\xac\xd8\xb9 \xd9\x85\xd8\xaf\xd9\x81\xd9\x88\xd8\xb9\xd8\xa7\xd8\xaa\xd9\x83",\n  "url": "https://example.com/?paymentId=PAYID-L2ILTHQ83R55588UV606981X&token=EC-5EB6693455269621L&PayerID=BLG98CXTZAX8S",\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n

我如何从 URL 访问 paymentId 和 PayerID 参数?

\n\n

我尝试了这一行,但两者都返回未定义const { PayerID, paymentId } = webViewState.url;

\n\n

有什么帮助吗?

\n

parameters url get webview react-native

1
推荐指数
1
解决办法
1650
查看次数