📜  jsx 中的 switch case - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:59.653000             🧑  作者: Mango

代码示例2
/* Hint: Use JS IIFE (Immediately invoked function expression) in JSX */

import React from 'react';

import ListView from './ListView';
import TableView from './TableView';

function DataView({
    currView,
    data,
    onSelect,
    onChangeStatus,
    viewTodo,
    editTodo,
    deleteTodo,
}) {
    return (
        
{(function () { switch (currView) { case 'table': return ( ); case 'list': return ( ); default: break; } })()}
); } export default DataView;