react-native-paper icon indicating copy to clipboard operation
react-native-paper copied to clipboard

Icons not loading in paper, works fine with react-native-vector-icons directly

Open sourabhv opened this issue 3 years ago • 5 comments

Current behaviour

Can't load icons from paper.

The source code checks for material icons with this code

try {
  // Optionally require vector-icons
  MaterialCommunityIcons =
    require('react-native-vector-icons/MaterialCommunityIcons').default;
} catch (e) {
...
}

and shows the console.warn message.

However if I write require('react-native-vector-icons/MaterialCommunityIcons').default in my source code, it works fine. I can even load icons using

import Icon from 'react-native-vector-icons/MaterialCommunityIcons';

// ...

<Icon name="chevron-right" size={20} color={color} />

Expected behaviour

Paper should be able to load icons

Code sample

Screenshots (if applicable)

Screenshot 2022-07-24 at 9 50 43 PM Screenshot 2022-07-24 at 9 51 12 PM Screenshot 2022-07-24 at 9 51 26 PM

What have you tried

I am kinda clueless to be honest, how can the same package work in my code and not in paper

Your Environment

software version
ios or android ios
react-native 0.69.2
react-native-paper 4.12.3
react-native-vector-icons 9.2.0
node v18.6.0
npm 8.13.2
expo sdk NA

sourabhv avatar Jul 24 '22 16:07 sourabhv

Hey! Thanks for opening the issue. The issue doesn't seem to contain a link to a repro (a snack.expo.dev link or link to a GitHub repo under your username).

Can you provide a minimal repro which demonstrates the issue? A repro will help us debug the issue faster. Please try to keep the repro as small as possible and make sure that we can run it without additional setup.

github-actions[bot] avatar Jul 24 '22 16:07 github-actions[bot]

Couldn't find version numbers for the following packages in the issue:

  • react-native-vector-icons
  • npm
  • expo

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

  • yarn (found: 8.13.2, latest: 1.22.19)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

github-actions[bot] avatar Jul 24 '22 16:07 github-actions[bot]

Couldn't find version numbers for the following packages in the issue:

  • expo

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

  • npm (found: 8.13.2, latest: 8.15.0)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

github-actions[bot] avatar Jul 24 '22 16:07 github-actions[bot]

Hey @sourabhv, could you please provide the repro?

lukewalczak avatar Jul 25 '22 07:07 lukewalczak

rnp-sample.zip

Hi, here's a zip. It shows 2 buttons, one has icon, other doesn't.

sourabhv avatar Jul 25 '22 22:07 sourabhv

Hello 👋, this issue has been open for more than a month without a repro or any activity. If the issue is still present in the latest version, please provide a repro or leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution or workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix it.

github-actions[bot] avatar Aug 25 '22 02:08 github-actions[bot]

For future reference the install instructions are these

rzfzr avatar Jul 17 '23 15:07 rzfzr