React-native-paper: icon source does not work when trying to use rtl using icon name

Created on 17 Feb 2020  路  2Comments  路  Source: callstack/react-native-paper

Current behaviour

I do not have any icon when writting this:

        <Button
          icon={{
            source: 'archive'
          }}
          mode="text"
          color={colors.white}
          title="Tap to undo"
          uppercase
        >
          Tap to undo
        </Button>

Expected behaviour

I expect to have the same behavior as in here:

        <Button
          icon="archive'
          mode="text"
          color={colors.white}
          title="Tap to undo"
          uppercase
        >
          Tap to undo
        </Button>

Code sample

I tried to do a snack, but icon are not displayed : https://snack.expo.io/@kopax/courageous-hummus

Your Environment

| software | version
| --------------------- | -------
| ios or android | all
| react-native | expo sdk36
| react-native-paper | 3.6.0
| node | 13.5.0
| npm or yarn | 6.13.7
| expo sdk | 36

Most helpful comment

You should pass direction in icon object
See the docs

<Button
          icon={{
            source: 'archive',
            direction: 'rtl'
          }}
          mode="contained"
          uppercase
>

All 2 comments

You should pass direction in icon object
See the docs

<Button
          icon={{
            source: 'archive',
            direction: 'rtl'
          }}
          mode="contained"
          uppercase
>

Thanks a lot

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alikazemkhanloo picture alikazemkhanloo  路  4Comments

makhataibar picture makhataibar  路  4Comments

yaronlevi picture yaronlevi  路  3Comments

zxccvvv picture zxccvvv  路  4Comments

tonyxiao picture tonyxiao  路  3Comments