Hi guys I’m just in the throws of learning JSX while completing my first project task (Animal Fun Facts 5). However my code returns no content in the browser. I can’t see anything wrong with the code myself and I’m beginning to think it’s a glitch, if anyone can assist that would be much appreciated!!
Thanks
(Pasted in JS but JSX syntax)
import { animals } from './animals';
import React from 'react';
import ReactDOM from 'react-dom';
const title = '';
const background = (
<img
className='background'
alt='ocean'
src='/images/ocean.jpg’
/>
)
const animalFacts = (
<div>
<h1>{title == '' ? 'Click an animal for a fun fact': title}</h1>
{background}
</div>
)
ReactDOM.render(animalFacts, document.getElementById('root'));