Mah*_*yar 9 javascript react-native
我想用来flashlist将项目渲染到屏幕上,根据文档,我们唯一需要做的就是重命名组件并向estimatedItemSize组件添加属性,所以我这样做了,但出现了这个奇怪的错误。
组件代码:
export const RestaurantsScreen = () => {
const { isLoading, error, clearError, sendRequest } = useHttpClient();
const [fetchedRestaurants, setFetchedRestaurants] = useState([]);
...
...
...
{!isLoading && fetchedRestaurants.length > 0 && (
<FlashList
data={fetchedRestaurants}
renderItem={renderItemComponent}
keyExtractor={(item) => item.name}
initialNumToRender={3}
estimatedItemSize={15}
/>
)}
</SafeArea>
);
};
Run Code Online (Sandbox Code Playgroud)
错误是:
Invariant Violation: requireNativeComponent: "AutoLayoutView" was not found in the UIManager.
This error is located at:
in AutoLayoutView (created by AutoLayoutView)
in AutoLayoutView (created by ScrollComponent)
in RCTView (created by View)
in View (created by ScrollComponent)
in ...
Run Code Online (Sandbox Code Playgroud)
它可以很好地与flatlist.
小智 -1
看到这条推文,看起来您需要构建一个自定义开发客户端:https://twitter.com/Baconbrix/status/1542574116850524162 ?s=20&t=pbf86KkE8JkhY5ZQ4Z_w_g
| 归档时间: |
|
| 查看次数: |
5047 次 |
| 最近记录: |