【问题标题】:how to export component with params in react如何在反应中导出带有参数的组件
【发布时间】:2023-01-05 18:17:48
【问题描述】:

我如何在反应中导出带有参数的组件?我想将此组件用作全局组件,以便在其他组件中使用它

这是我的组件表,它将接收的参数是一个关联数组

import Table from 'react-bootstrap/Table';

const Table = (datos)=>{
    <Table>
       <thead>
        <tr>
            <th>Nombre</th>
            <th>Apellido</th>
            <th>Movil</th>
            <th>DNI</th>
            <th>Email</th>
        </tr>
        <tbody>
            <tr>
                <td>{data.nombre}</td>
                <td>{data.apellido}</td>
                <td>{data.movil}</td>
                <td>{data.dni}</td>
                <td>{data.email}</td>
            </tr>
        </tbody>   
       </thead>
    </Table>
}

export default table;

【问题讨论】:

    标签: javascript reactjs react-native jsx


    【解决方案1】:

    导出默认表。你写了(表格)

    【讨论】:

    • 是的,我知道,但是我怎样才能将这个组件导入另一个组件,然后在导入后将地图传递给它
    猜你喜欢
    • 1970-01-01
    • 2020-08-23
    • 1970-01-01
    • 2013-08-01
    • 2018-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-09
    相关资源
    最近更新 更多