Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/oneted11/react-cdn-scrimba

using react as an add-on
https://github.com/oneted11/react-cdn-scrimba

javascript react react-cdn scrimba-react

Last synced: 12 days ago
JSON representation

using react as an add-on

Awesome Lists containing this project

README

        

### Scrimba react course

# using react and jsx only using CDN

useful for when you dont want a toolchain and just want to add components real quick to an already exsisting html css project

## index.html

```html





React-CDN-Test







```

## index.js

```jsx
ReactDOM.render(

HEllo there


GeneRAl KenoBI


,
document.getElementById("root")
);
```

# Components and Props

This is a thing that is possible apparently in this type of setup :exploding_head:

## index.js

```js
//components
function P1(props) {
return

{props.text}

;
}
function P2(props) {
return

{props.text}

;
}

//composing components into page
ReactDOM.render(



,
document.getElementById("root")
);
```

# creating an element using pure js

```js
//create h1
let myhead = document.createElement("h1");
//add text
myhead.textContent = "Hello, React!";
//add class
myhead.classList.add("header");
//select root
let root = document.getElementById("root");
//append to root div
root.appendChild(myhead);
```