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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add FABGroup to index page but throw exception in html. #4549

Open
whoooami opened this issue Nov 11, 2024 · 0 comments
Open

add FABGroup to index page but throw exception in html. #4549

whoooami opened this issue Nov 11, 2024 · 0 comments
Labels

Comments

@whoooami
Copy link

Current behaviour

Every time when refresh page include this component in h5, it throw some exception.

Expected behaviour

show without exception.

How to reproduce?

https://callstack.github.io/react-native-paper/docs/components/FAB/FABGroup

import * as React from 'react';
import { FAB, Portal, PaperProvider } from 'react-native-paper';

const FabGroup = () => {
  const [state, setState] = React.useState({ open: false });

  const onStateChange = ({ open }) => setState({ open });

  const { open } = state;

  return (
    <Portal>
      <FAB.Group
        open={open}
        visible
        icon={open ? 'calendar-today' : 'plus'}
        actions={[
          { icon: 'plus', onPress: () => console.log('Pressed add') },
          {
            icon: 'star',
            label: 'Star',
            onPress: () => console.log('Pressed star'),
          },
          {
            icon: 'email',
            label: 'Email',
            onPress: () => console.log('Pressed email'),
          },
          {
            icon: 'bell',
            label: 'Remind',
            onPress: () => console.log('Pressed notifications'),
          },
        ]}
        onStateChange={onStateChange}
        onPress={() => {
          if (open) {
            // do something if the speed dial is open
          }
        }}
      />
    </Portal>
  );
};

export default FabGroup;

Preview

Image

What have you tried so far?

Your Environment

software version
ios x
android x
react-native 0.74.5
react-native-paper ^5.12.5
node 21.1.0
npm or yarn 1.22.22
expo sdk ~51.0.28
@whoooami whoooami added the bug label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant