React is the implementation method for passing the class name to the child component through the parent component.

Source: Internet
Author: User

React is the implementation method for passing the class name to the child component through the parent component.

React tutorial

React is a JAVASCRIPT library used to build user interfaces.
React is mainly used to build the UI. Many people think that React is the V (View) in MVC ).
React originated from Facebook's internal project, which was used to build Instagram websites and was open-source in May 2013.
React has high performance and the code logic is very simple. More and more people are paying attention to and using it.

React features

1. Declarative design-React uses the declarative paradigm to easily describe applications.
2. Efficient-React simulates DOM to minimize interaction with DOM.
3. Flexibility-React can work well with known libraries or frameworks.
4. JSX-JSX is an extension of JavaScript syntax. JSX is not necessarily used for React development, but we recommend that you use it.
5. component-build components through React to make code more reusable and be well applied to the development of large projects.
6. One-way response data streams-React implements one-way response data streams, thus reducing repeated code, which is why it is simpler than traditional data binding.

1. Method for passing the class name to the child component through the parent component (19th rows)

2. Apply some class names (22nd rows) with different status values)

 import React from 'react'import './style.css'class PageTitle extends React.Component {  constructor(props, context) {    super(props, context);    this.state = {      timeType:0    }  }  handleClick(timeType){    this.setState({      timeType:timeType    });    this.props.handle(timeType+1);  }  render() {    const {title,dataList} = this.props;    return (     

Summary

The above is the implementation method of the React that passes the class name to the child component through the parent component. I hope it will be helpful to you. If you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.