React-native-paper: Icon prop error.

Created on 28 Aug 2019  路  9Comments  路  Source: callstack/react-native-paper

Ask your Question

As it says in documentation, I tried to add button with icon which is 'dots-vertical'. And it says that is invalid though the document says that icon is in the supported list.

And I'm using expo so AFAIK there's no need of extra configuration.

The error message was : Invalid prop name of value 'dots-vertical' supplied to 'icon'.

The code was like below :
<Button icon='dots-vertical' size={20} onPress={() => {this._openMenu}} />

Please help with this problem. Many thanks!

question

Most helpful comment

I can confirm the following from @rodrigo98rm

Icon names on my project seem to point to Google Material Icons, but the icon list available on the docs point to Material Community Icons.

If Material Community Icons works only on (3.x), which is currently on alpha (according to the releases page), shouldn't the docs show the list of icons available for (2.x)?

Also, I am a little confused with the docs. Are they entirely 3.x ? Or are they 2.x with some (probably misplaced) 3.x parts ?
For the record, I lost about one hour trying icons, checking linking of my react-native-vector-icon lib, checking my ttf files and so on.

All 9 comments

@cngjsskaisme you could try more-vert for the icon prop instead

@cngjsskaisme you could try more-vert for the icon prop instead

Thanks for your comment but that didn't help... But anyways I appreciate it :)

@cngjsskaisme Which version of Paper are you using? 2.x or 3.x (master)

@jaysbytes I have followed the 'Getting started' page instructions, so I think it's 3.x.

You should check the version in package.json.
Check this example https://snack.expo.io/@jaysbytes/jealous-carrot
In your case dots-vertical (3.x) or more-vert (2.x) should work. If both don't work I cannot help without more complex reproduction

I'm experiencing the very same issue.
My environment:

  • React Native without Expo
  • React Native Paper V2.16.0

Icon names on my project seem to point to Google Material Icons, but the icon list available on the docs point to Material Community Icons.

If Material Community Icons works only on (3.x), which is currently on alpha (according to the releases page), shouldn't the docs show the list of icons available for (2.x)?

I can confirm the following from @rodrigo98rm

Icon names on my project seem to point to Google Material Icons, but the icon list available on the docs point to Material Community Icons.

If Material Community Icons works only on (3.x), which is currently on alpha (according to the releases page), shouldn't the docs show the list of icons available for (2.x)?

Also, I am a little confused with the docs. Are they entirely 3.x ? Or are they 2.x with some (probably misplaced) 3.x parts ?
For the record, I lost about one hour trying icons, checking linking of my react-native-vector-icon lib, checking my ttf files and so on.

This issue is far from closed

I'm using 3.6.0 and Google Material Icons doesn't seem to work either.
I've posted the available name list here (extracted from their warning message, have no idea where it came from). Hope they update the docs soon.

Was this page helpful?
0 / 5 - 0 ratings