0
votes

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

1
Maybe because your method is named rander? - ray hatfield
thank you so much you saved lots of my time - yash adhikari

1 Answers

1
votes

Check this:

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

export default Navbar;