Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[03]react的jsx语法介绍和使用 #11

Open
duxinyues opened this issue Sep 24, 2020 · 0 comments
Open

[03]react的jsx语法介绍和使用 #11

duxinyues opened this issue Sep 24, 2020 · 0 comments

Comments

@duxinyues
Copy link
Owner

官方的描述:JSX是一个 JavaScript 的语法扩展。我们建议在 React 中配合使用 JSX,JSX 可以很好地描述 UI 应该呈现出它应有交互的本质形式。JSX 可能会使人联想到模版语言,但它具有 JavaScript 的全部功能。它没有任何语义,专门提供给与处理器使用。

const  dom = <div>这是一个jsx语法使用.</div>

在react中声明组件的时候使用jsx,如以下声明的组件:

import React from "react";
class ClassComponent extends Reacrt.Component {

    render() {
        return <div>
            在声明组件的时候使用jsx语法
   </div>
    }
}


export default ClassComponent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant