Introduction to React.js (cont)

January 10, 2021

Table of Contents

On the previous post we created a basic sample React.js application using the create-react-app utility.

Now, on this post we are going to create the same application but using the React.js CDN Links. This method is more convenient when you already have an existing website to which you want to integrate React.js code.

When you use the CDN links you don't need to have installed either Node.js or the npm utility.

Sample App, using CDN Links

On a new html file on your website put the following code:

<!DOCTYPE html>
        <script src=""></script>
        <script src=""></script>
        <script src=""></script>
        <div id="root"></div>
            .header {
                margin: 10px;
                padding: 10px;
                border: 1px solid black;
            .container {
                margin: 10px;
                border: 1px dashed black;
            .item {
                margin: 5px;
                padding: 5px;
                border: 1px dashed black;
        <script type="text/babel">
            const notes = [
                {id: 1, title: 'Item 1' },
                {id: 2, title: 'Item 2' },
                {id: 3, title: 'Item 3' }
            function Header() {
                return (
                    <div className="header">Sample Notes App</div>
            function Notes(props) {
                const notes = props.notes;
                return (
                    <div className="container">
                        { =>
                            <Note key={} value={note.title} />
            function Note(props) {
                return (
                    <div className="item">{props.value}</div>
                    <Header />
                    <Notes notes={notes} />

Then, open your browser and enter the url of your html page to view the sample app.