A Bite Of React
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了A Bite Of React相关的知识,希望对你有一定的参考价值。
react:
component and views : produce html abd add them on a page( in the dom)
<import React from ‘react‘> // core react library, know how to work with component. Create or manage a Dom <import ReactDOM from ‘react-dom‘> //render component to dom const App = function(){ return <div>HI!</div> }; // this is a component class, could produce a lot of instance.
- ES6
const: ES6 syntax, declare a variable. And which means it won‘t change because it is constant
JSX:
- subset of javascript which looks like html but cannot be interpreted by browser.
- JSX could produce HTML
- JSX could be compiled into vanilla javascript( which means plain JS without any additional libraries)
ReactDOM.render(<App />, document.querySelector(‘.container‘)); //render component into dom // transpire would translate JSX into javascript
// <App />is a simple instance of component App
const App1 = () => { return <div>Hi!</div>; } // => equals to keyword:this
以上是关于A Bite Of React的主要内容,如果未能解决你的问题,请参考以下文章
SpringBoot启动报错“Consider defining a bean of type ‘xxx.mapper.UserMapper‘ in your configuration.“(代码片段
报错“Field pet in XXX.HelloController required a bean of type ‘XXX.Pet‘ that could not be found.“(代码片段
leetcode_1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold_[二维前缀和](代码片段
TP5报如下的错误 Indirect modification of overloaded element of thinkpaginatorCollection has no effect(代码片段