VK
Аля вместо:
{b1 ? <C1/> : b2 ? <C2/> : b3 ? <C3/> : null }
Лучше будет выглядеть
{(b1 && <C1/>) || (b2 && <C2/>) || (b3 && <C3/>) }
Я скажу страшное, но мне кажется, что foo === null ? : лучше, чем foo ? : :)
Size: a a a
VK
{b1 ? <C1/> : b2 ? <C2/> : b3 ? <C3/> : null }
{(b1 && <C1/>) || (b2 && <C2/>) || (b3 && <C3/>) }
AG
KK
AG
{
(expand === NExplorerEntityExpandType.dir && ListData &&
<FixedSizeList outerRef={ref}
itemCount={ListData.length}
height={height - 2}
width={width - 2}
itemSize={32}
itemData={ListData}
>
{Item}
</FixedSizeList>)
|| (opend?.type === NExplorerEntityType.file_empty &&
<Typography>Пустой файл</Typography>)
|| (expand === NExplorerEntityExpandType.txt && TxtData && opend!.encoding &&
<MyMonacoEditor
height={height - 2}
width={width - 2} data={TxtData} encoding={opend!.encoding} />)
}
DN
const some = data? data.map()... : null;
return(
<div>{ some } </div>
)
RS
const some = data? data.map()... : null;
return(
<div>{ some } </div>
)
VK
AG
const some = data? data.map()... : null;
return(
<div>{ some } </div>
)
DN
RS
RS
DN
RS
AG
{
(expand === NExplorerEntityExpandType.dir && ListData &&
<FixedSizeList outerRef={ref}
itemCount={ListData.length}
height={height - 2}
width={width - 2}
itemSize={32}
itemData={ListData}
>
{Item}
</FixedSizeList>)
|| (opend?.type === NExplorerEntityType.file_empty &&
<Typography>Пустой файл</Typography>)
|| (expand === NExplorerEntityExpandType.txt && TxtData && opend!.encoding &&
<MyMonacoEditor
height={height - 2}
width={width - 2} data={TxtData} encoding={opend!.encoding} />)
}
{expand === NExplorerEntityExpandType.dir && ListData ? (
<FixedSizeList
outerRef={ref}
itemCount={ListData.length}
height={height - 2}
width={width - 2}
itemSize={32}
itemData={ListData}>
{Item}
</FixedSizeList>
) : opend?.type === NExplorerEntityType.file_empty ? (
<Typography>Пустой файл</Typography>
) : expand === NExplorerEntityExpandType.txt &&
TxtData &&
opend!.encoding ? (
<MyMonacoEditor
height={height - 2}
width={width - 2}
data={TxtData}
encoding={opend!.encoding}
/>
) : null}
RS
RS
AG
DN
AG