Skip to content

Defaultprops warning when using OverflowMenu #1813

Open
@Tubio

Description

@Tubio

💬 Question

I have an OverflowMenu that is throwing the following warning:
Warning: MeasureElement: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

OverflowMenu Implementation:

<View style={{ flex: 1, flexDirection: 'row' }}>
  <Text style={{ flex: 2, textAlign: 'left', color: 'black' }}>{item.quantity}</Text>
  <OverflowMenu
    anchor={() => renderToggleButton(index)}
    visible={visibleIndex === index}
    onSelect={() => setVisibleIndex(null)}
    onBackdropPress={() => setVisibleIndex(null)}
  >
    <MenuItem title='Full' />
    <MenuItem title='Low' />
    <MenuItem title='Consumed' />
  </OverflowMenu>
</View>

renderToggleButton:

const renderToggleButton = useCallback((index) => (
    <TouchableOpacity onPress={() => setVisibleIndex(index)}>
      <View style={{ flex: 1 }}>
        <Icon name="arrow-down" style={{ width: 20, height: 20 }} />
      </View>
    </TouchableOpacity>
  ), [])

UI Kitten and Eva version

Package Version
@eva-design/eva 5.3.1
@ui-kitten/components 5.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions