react——如何实现插槽传递数据?

import React, { Component } from 'react'
import Cpn from './Cpn'

export default class App extends Component {
    render() {
        return (
            
aaa} center={bbb} right={ccc}/>

这里是内容

) } }
import React, { Component } from 'react'

export default class Cpn extends Component {
    render() {
        const{left,center,right}=this.props;
        return (
            
{left}
{center}
{right}
) } }

其实和父子间属性传递数据一个样子嘛~~~

你可能感兴趣的:(react——如何实现插槽传递数据?)