Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defaultprops warning when using OverflowMenu #1813

Open
Tubio opened this issue May 9, 2024 · 2 comments 路 May be fixed by #1818
Open

Defaultprops warning when using OverflowMenu #1813

Tubio opened this issue May 9, 2024 · 2 comments 路 May be fixed by #1818

Comments

@Tubio
Copy link

Tubio commented May 9, 2024

馃挰 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
@agottfredsson
Copy link

+1

@mdicampli
Copy link

This also occurs on Modal implementation:

Warning: MeasureElement: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

@rklomp rklomp linked a pull request May 24, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants