-2

I am working on a Amazon clone with React.js but when I run my code
I don't see any content on the webpage
here is my code

enter image description here

And here is the webpage

enter image description here

kiranvj
  • 32,342
  • 7
  • 71
  • 76

3 Answers3

0

You have an error in your code. Open the console on your browser to checkout the error. [CTRL + SHIFT + I] in chrome.

Esam Olwan
  • 320
  • 1
  • 5
  • 16
0

Open the console on your browser to checkout the error. [CTRL + SHIFT + C] in Mozila.

0

Not sure which version of react router are you using.

Instead of passing elements as children, use the element props as mentioned in docs

Example:

<Route path="/" element={<><Header /><Home /></>} />

"Uncaught Error: [Header] is not a component. All component children of must be a or <React.Fragment>"

or try wrapping children with React.Fragment or <></>

 <Route path="/">
   <>
     <Header />
     <Home />
   </>
 </Route>
kiranvj
  • 32,342
  • 7
  • 71
  • 76
  • Yeah it worked, I just have one more question I am very new to React.js so now I get this error "Warning: Each child in a list should have a unique "key" prop." Do you know what it means? – Muhammed Kaysi Jul 04 '22 at 13:51
  • Please accept the answser if the solution works. For the keys error check [this](https://stackoverflow.com/questions/28329382/understanding-unique-keys-for-array-children-in-react-js) and [this](https://sentry.io/answers/unique-key-prop/) . You can also [Google](https://www.google.com/search?q=react+each+child+unique+key&rlz=1C1GCEB_enIN1005IN1005&oq=React+each+child&aqs=chrome.1.69i57j0i512l4j0i390l5.5709j0j7&sourceid=chrome&ie=UTF-8) the error for more results – kiranvj Jul 04 '22 at 13:53