Adam Angel
Adam Angel

Reputation: 31

Component names need to start with capital letter?

So I am trying to use this https://github.com/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.com/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 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 . . 

Upvotes: 3

Views: 3624

Answers (2)

Axmedbek
Axmedbek

Reputation: 1

Yes,components' names must start with capital letter , because , when you write component name with small letter , compiler runs it like as html tag, but when you write with capital letter , compiler runs it from your javascript file location.

Upvotes: 0

Phillip
Phillip

Reputation: 6253

It 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 compatible

Upvotes: 5

Related Questions