admin管理员组文章数量:1026676
So I am trying to use this as part of my hybrid react app. However when I copy and paste the code into my project it gives me an error
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="/" tabs="timeline"
/>
</FacebookProvider>
);
}
}
The idea is to have a facebooks pages feed show up on my app screen. However I get this error:
Invariant Violation: View config not found for name div. Make sure to start ponent 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 . .
So I am trying to use this https://github./seeden/react-facebook as part of my hybrid react app. However when I copy and paste the code into my project it gives me an error
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./somepage/" tabs="timeline"
/>
</FacebookProvider>
);
}
}
The idea is to have a facebooks pages feed show up on my app screen. However I get this error:
Invariant Violation: View config not found for name div. Make sure to start ponent 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 . .
Share
Improve this question
edited Jul 29, 2019 at 13:45
adiga
35.3k9 gold badges65 silver badges87 bronze badges
asked Jul 29, 2019 at 13:34
Adam AngelAdam Angel
311 silver badge2 bronze badges
2
- 2 Include the text of the error, not a screenshot. Search engines won't index based on the error in the image. – random_user_name Commented Jul 29, 2019 at 13:35
- Maybe there is something wrong with your configuration. Have you tried github./facebook/create-react-app. It creates you a new project with an example page. It's just one mand and everything should be generated and configured correctly. – Frank Roth Commented Jul 29, 2019 at 13:51
2 Answers
Reset to default 5It looks like seeden/react-facebook is built for browsers and the DOM. You cannot use <div>
and the likes in React Native -- This means you have to implement this library yourself, or find something else that is React Native patible
Yes,ponents' names must start with capital letter , because , when you write ponent name with small letter , piler runs it like as html tag, but when you write with capital letter , piler runs it from your javascript file location.
So I am trying to use this as part of my hybrid react app. However when I copy and paste the code into my project it gives me an error
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="/" tabs="timeline"
/>
</FacebookProvider>
);
}
}
The idea is to have a facebooks pages feed show up on my app screen. However I get this error:
Invariant Violation: View config not found for name div. Make sure to start ponent 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 . .
So I am trying to use this https://github./seeden/react-facebook as part of my hybrid react app. However when I copy and paste the code into my project it gives me an error
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./somepage/" tabs="timeline"
/>
</FacebookProvider>
);
}
}
The idea is to have a facebooks pages feed show up on my app screen. However I get this error:
Invariant Violation: View config not found for name div. Make sure to start ponent 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 . .
Share
Improve this question
edited Jul 29, 2019 at 13:45
adiga
35.3k9 gold badges65 silver badges87 bronze badges
asked Jul 29, 2019 at 13:34
Adam AngelAdam Angel
311 silver badge2 bronze badges
2
- 2 Include the text of the error, not a screenshot. Search engines won't index based on the error in the image. – random_user_name Commented Jul 29, 2019 at 13:35
- Maybe there is something wrong with your configuration. Have you tried github./facebook/create-react-app. It creates you a new project with an example page. It's just one mand and everything should be generated and configured correctly. – Frank Roth Commented Jul 29, 2019 at 13:51
2 Answers
Reset to default 5It looks like seeden/react-facebook is built for browsers and the DOM. You cannot use <div>
and the likes in React Native -- This means you have to implement this library yourself, or find something else that is React Native patible
Yes,ponents' names must start with capital letter , because , when you write ponent name with small letter , piler runs it like as html tag, but when you write with capital letter , piler runs it from your javascript file location.
本文标签: javascriptComponent names need to start with capital letterStack Overflow
版权声明:本文标题:javascript - Component names need to start with capital letter? - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745651238a2161332.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论