0

so i am just a begineer who started learning reactJS i wrote below code to display a output but its showing blank page can some one please correct my code and tell me whats wrong why its showing blank page

 { import React from 'react';
import ReactDOM from 'react-dom';
import App from './App'

function Bookshop(){

  return(
    <section>
       <Book />
    </section>
    
  );

}

const  Book = () => {

  return(
    <article>
     <author />
    </article>
  );

};


const bookImg = () =>{

  return(
    <img src=""/>
  );

};

const author = () =>{

  return(
    <h1>harry potter</h1>
  )

}

ReactDOM.render(
   <Bookshop />,
  document.getElementById('root')
); 

}
nabila
  • 13
  • 1
  • 1
    I'm not sure if it's this but your code is wrapped between {} in your example – Nicolas Menettrier Jun 24 '21 at 07:46
  • Does this answer your question? [ReactJS component names must begin with capital letters?](https://stackoverflow.com/questions/30373343/reactjs-component-names-must-begin-with-capital-letters) – Janez Kuhar Jun 24 '21 at 07:54

1 Answers1

0

Just change author to be uppercase: Author and it will work.

React components must start with an upperCase letter.

Sagi Rika
  • 2,839
  • 1
  • 12
  • 32