Hello, world!,
document.getElementById('root')
);
Uni /src/App.js fayliga quyidagicha yozishingiz mumkin:
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
render() {
return (
Hello, world!
);
}
}
export default App;
|
Yana bir varianti (createElement yordamida):
1
2
3
4
5
6
7
8
9
10
11
|
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
render() {
return React.createElement("h1", null, 'Hello World');
}
}
export default App;
|
Komponentsiz ko’rinishi:
1
2
3
4
5
6
7
|
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
const App = () => Hello world
export default App;
|
React sintaksisi ES6 va JSXdan iborat bo’lib, umumiy holda Javascriptning zamonaviy ko’rinishiga ega.
Node.js haqida
Salom dasturchilar! Bu maqolada Node.js haqida gapirib bermoqchiman. Node.js ham front-end, ham back-end dasturchilar ishlatishadi. Node.js judayam ommalashib ketdi, shuning uchun Node.js nimaligini bilish zarar qilmaydi.
Do'stlaringiz bilan baham: |