Untitled

mail@pastecode.io avatar
unknown
javascript
2 years ago
646 B
4
Indexable
Never
//my index.js

import React from "react"
import ReactDOM from "react-dom"
import Photo from "./components/Photo.js"

function App() {
    return (
        <Photo />
    )
}

ReactDOM.render(<App />, document.getElementById("root"))

//my index.html

<html>
    <head>
        <link rel="stylesheet" href="style.css">
    </head>
    <body>
        <div id="root"></div>
        <script src="index.pack.js"></script>
    </body>
</html>

//my Photo.js in components folder

import React from "react"

export default function Photo() {
    return (
        <img alt="my photo" src="./images/person1.png" />
    )
}