maru react course eka mitoooos

BR004

Junior member
  • Oct 27, 2022
    28
    31
    13
    Simple React JS App using only CDN, No imports, also with state managements.

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8" />
    <title>Hello World</title>
    <script src="https://unpkg.com/react@17/umd/react.development.js"></script>
    <script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
    <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
    </head>
    <body>
    <div id="root"></div>
    <script type="text/babel">
    function Example() {
    const [count, setCount] = React.useState(0);
    // Similar to componentDidMount and componentDidUpdate:
    React.useEffect(() => { // Update the document title using the browser API
    document.title = `You clicked ${count} times`; });
    return (
    <div>
    <p>You clicked {count} times</p>
    <button onClick={() => setCount(count + 1)
    }>
    Click me

    </button>
    </div>
    );
    }
    ReactDOM.render(
    <Example />,
    document.getElementById('root')
    );
    </script>
    </body>
    </html>
     

    thrindo

    Active member
  • May 18, 2022
    345
    248
    43
    Thank you for sharing. ❤️❤️

    ගන්න සල්ලි තමා නැත්තෙ. interactive කෝස් එකක් නිසා ඩවුන්ලෝඩ් කරත් ෆුල්ල් එක්ස්පීරියන්ස් එක ගන්න බැහැනෙ

    කමති කට්ටිය මේ කෝසුත් බලන්න. youtube එකේ Fireship හදපු කෝස් වගයක්. සුපිරිම .
    ඔරිජිනල් සයිට් එක - https://fireship.io/courses/
    ඩවුන්ලෝඩ් කරන ලිංක් එක - https://drive.google.com/drive/folders/1X1WkHTEDCpNbIGXVtDINV4Y89e1-mhQ3?usp=sharing

    පුලුවන් අය ඔක්කොම ඩවුන්ලෝඩ් කර ගන්න, මොකද ලිංක් එක අයින් කරොත්..
    පුලුවන් අය සල්ලි ගෙවල ගන්න..