react fun tion
// it a component
import React from 'react';
class App extends React.Component {
//call function (ECMAScript 5) from tag input:text
handleChange = e => {
//
console.log(`${e.target.value}`)
}
render() {
return (
<div className="App">
<input type="text" name="input" id="" placeholder="" onChange={this.handleChange}/>
</div>
);
}
}
export default App;import React from 'react'; const App = () => { const greeting = 'Hello Function Component!'; return <Headline value={greeting} />;}; const Headline = ({ value }) => <h1>{value}</h1>; export default App;Props is a way to transform data from one component to another.
<Ball numbre = '1'/>
//IN component
{this.props.numbre} // in html is 1
Also in JavaScript:
- javascript get last element of array
- get today date and time in js
- jest object containing
- javascript open new window
- defer parsing of javascript avada
- js class private
- javascript detectar la pagina
- javascript ceiling
- angular component lifecycle hooks
- generate random number javascript
- javascript validate email
- node js event emitter
- number to string javascript
- get each primary colour and add into an array javascript
- add property to object javascript
- javascript code for find the last element in array
- document queryselectorall and map javacript
- js dom ready function
- nodejs include json file
- include jquerty
- jquery advace
- javascript loop over classlist
- sort array based on another array
- node express dynamic route and error handler