【发布时间】: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