React js reja: React jsni o’rnatish React js kompanentlari React jsda ilova


Download 111.1 Kb.
bet2/5
Sana24.12.2022
Hajmi111.1 Kb.
#1056882
1   2   3   4   5
Bog'liq
react js

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.

Download 111.1 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling