react function component
class App extends Component {
constructor() {
super()
this.state = {
name: "Sally",
age: 13
}
}
render() {
return (
<div>
<h1>{this.state.name}</h1>
<h3>{this.state.age} years old</h3>
</div>
)
}
}class MyComponent extends React.Component{
constructor(props){
super(props);
};
render(){
return(
<div>
<h1>
My First React Component!
</h1>
</div>
);
}
};
class Welcome extends React.Component {
render() {
return <h1>Hello, {this.props.name}</h1>;
}
}function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}
function App() {
return (
<div>
<Welcome name="Sara" /> <Welcome name="Cahal" /> <Welcome name="Edite" /> </div>
);
}
ReactDOM.render(
<App />,
document.getElementById('root')
);const component = () => {
console.log("This is a functional Component");
}function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}
Also in JavaScript:
- shadow using react native
- jquery prevent form submit
- jquery get all paragraphs
- how to make vue app talk to backend on 8000
- js canvas draw polygon
- run command line using javascript
- how to get an array from another script in js
- canvas nodejs
- change text size according to screen react native
- first duplicate javascript
- public static void main(dsjjsdds, jdnjd, jsndjsd, isjdjsd, sjdijs, skjdks_+) __ osakd___ +++
- p5js check for keyboard keys
- js obj
- javascript append to json
- column gap without affecting width site:stackoverflow.com
- cache buster in angular application
- how to push multiple data to different parents in a single request in firebase
- javascript async await returns undefined
- check if field exists in object javascript
- deparam javascript
- ionic 1 decorator example
- js promise examples
- array reduce and count based on proeperty js
- using fb login with angular app