yash adhikari
yash adhikari

Reputation: 63

could not export component in react ||TypeError: instance.render is not a function

hellow, i was trying export class base component in app.js of my react app, but i got an error saying TypeError: instance.render is not a function,

Navbar.js

import React, { Component} from 'react';
class Navbar extends Component {
    rander(){
        return(
            <div>
            <h1> hellow world </h1>
            </div>
        )
    }
}

export default Navbar;

App.js

import React from 'react';
import './App.css';
import Navbar from './Compoment/Layout/Navbar'

function App() {
  return (
    <div >
      <Navbar />
   </div>  
  );
}

export default App;

this is the error that i am get in my browser

Upvotes: 0

Views: 51

Answers (1)

Saul Ramirez
Saul Ramirez

Reputation: 426

Check this:

import React, { Component} from 'react';
class Navbar extends Component {
    render(){
        return(
            <div>
            <h1> hellow world </h1>
            </div>
        )
    }
}

export default Navbar;

Upvotes: 1

Related Questions