Repository URL to install this package:
|
Version:
0.14.1 ▾
|
ui-component-library
/
src
/
components
/
molecules
/
SelectDropDown
/
Option
/
_circularRenderProp.tsx
|
|---|
// lib
import React from 'react'
import { isObj, EMPTY_OBJ } from 'exotic'
// local
import { SelectableState } from 'src/state/SelectionState'
import { SelectProps } from '../typings'
import { SelectText } from './styled'
import { Option } from './Option'
import { OptionProps, OptionState, OptionType } from './typings'
export function renderItem(
item: OptionType,
props: SelectProps,
state: SelectableState
) {
const onClick = item.onClick
console.debug('[Option] renderItem')
console.dir(item)
console.log('[Component] Options circularRenderProps', item, props)
return Option.from(
{ ...item, onClick },
{ ...props, label: item.label, value: item.label }
)
}