Extra function replaceColumnFlex
Pre-release
Pre-release
Adds possibility to accept columnFlex prop as a multidimensional array and function replaceColumnFlex to switch between those arrays.
Note: the first item in an array will always be the default
Example
const initialColumns = [
['0 0 25%', '1 1 75%'],
['0 0 25%', '1 1 50%', '0 0 25%'],
['0 0 20%', '1 1 40%', '0 0 20%', '0 0 20%'],
]
const columns = [{}, {}, {}]
<DataBrowser
initialColumnFlex={initialColumns}
columns={columns}
totalItems={columns.length}
>
{({replaceColumnFlex, availableColumnFlex}) => (
<button
onClick={() => replaceColumnFlex({ columnFlex: availableColumnFlex[1] })}
>
click me
</button>
)}
</DataBrowser>