'How can I implement a condition in the renderCell method of a MUI GridColDef component?

I'm using the Mui Grid component and want to render the content of one column based on some conditions of the data.

How can I basically implement a conditional in the renderCell method?

const columns: GridColDef[] = [

      { field: 'offer_status',
          headerName: 'Status',
          flex: 1,
          width: 50,
          renderCell: (params) => ({
            if (params.value == 'is_sent')
                return <div>Sent</div>
          }
      )},

This doesn't work - I assume due to the syntax (unexpected token).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source