gpt4 book ai didi

javascript - 组件名称需要以大写字母开头?

转载 作者:搜寻专家 更新时间:2023-11-01 00:27:13 26 4
gpt4 key购买 nike

所以我正在尝试使用这个 https://github.com/seeden/react-facebook作为我的混合 react 应用程序的一部分。但是,当我将代码复制并粘贴到我的项目中时,出现错误

import React, {Component } from 'react';
import { FacebookProvider, Page } from 'react-facebook';
//import {createBottomTabNavigator, createAppContainer} from 'react-
navigation';
export default class Home extends Component {
render(){
//const { navigate } = this.props.navigation
return (
<FacebookProvider appId="2319566588264121">
<Page href="https://www.facebook.com/somepage/" tabs="timeline"
/>
</FacebookProvider>
);
}
}

我的想法是在我的应用程序屏幕上显示一个 facebooks 页面提要。然而I get this error :

Invariant Violation: View config not found for name div. Make sure to start component names with a capital letter.

This error is located at:
in div (created by Page)
in Page (created by Parser)
in Initialize (created by Context.Consumer)
in ForwardRef (created by Parser)
in div (created by Parser)
in Parser (created by ForwardRef)
in ForwardRef (at Home.js:18)
in Facebook (at Home.js:17)
in Home (at SceneView.js:0)
in SceneView (at createTabNavigator.js139)
in RCTView (at View.js:45)
in View (at ResourceSavingScene.js:37)
in RCTView (at View.js:45)
in View (at ResourceSavingScene.js:26)
in ResourceSavingScene (at createllottomTabNavigatorls:121)
in RCTView (at View.js:45)
in View (at screens.native.js:83)
in ScreenContainer (at create00ttomTabNavigator.js:111)
in RCTView (at View.js:46)
in View (at createBottomTabNavigator.js: 110)
in TabNavigationView (at createTabNavigator.js:197)
in NavigationView (at createNavigator.js:61)
in Navigator (at createAppContainer.js:429)
in NavigationContainer (at . .

最佳答案

看起来像seeden/react-facebook专为浏览器和 DOM 而构建。您不能使用 <div>以及 React Native 中的类似内容——这意味着您必须自己实现这个库,或者找到其他与 React Native 兼容的东西

关于javascript - 组件名称需要以大写字母开头?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57255031/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com