我尝试显示一个远程图像,它是一个HTTPS url。
我试过了:
import React, {useContext} from 'react';
import {View, Image, StyleSheet} from 'react-native';
const MyScreen = ({navigation}) => {
const {data} = ... // This is backend responsed data
// I verified the imageSource is https://www.example.com/
我有一个从纽约时报运行API调用的单张表。我能够渲染我需要的每一本书的信息,但我在从API调用呈现图书图像时遇到了困难。
import React, { Component } from "react";
import { StyleSheet, Text, View, Image, FlatList } from "react-native"
import BookItem from "./src/BookItem"
import fetchBooks from "./src/API" //function to call a
当我在我的应用程序上使用钩子时,我得到了的错误:无效的钩子调用。我不知道为什么要得到这个错误,因为我认为它是在函数组件中调用的?
Server Error
Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as R