How to insert image using react.js

1

I'm starting in the react, and how do I insert an image that stays on top of my background, which is already an image? The code is as follows:

import React from 'react'

import Img from 'react-image'

import teacher1 from "./images/teacher1.jpg"

import Navbar from './Navbar'

const AboutPage = () => {

  return (

    <div>
      <Navbar />
      <div className='header-container flex row center-center full-view' >
      <h1 id="sobre">Esse sistema serve para facilitar o planejamento <br/> da carga horária de cada turma, 
          bem como <br/> horário de aulas, docentes que estão <br/> ministrando aula em determinada hora e sala.</h1>
          <img src="./images/teacher1.jpg"/>
          <img src="./images/teacher2.jpg"/>

    </div>
    </div>
  )
}

export default AboutPage;

I tried to insert two images, but failed attempt.

    
asked by anonymous 26.06.2018 / 19:37

1 answer

0

Try to do so:

import teacher1 from "./images/teacher1.jpg";

<img src="{teacher1}" alt="Alguma coisa"/>
    
26.06.2018 / 20:14