dancormier / react-native-swipeout

iOS-style swipeout buttons behind component
MIT License
2.62k stars 649 forks source link

Use Fontawesome with Swipeout #242

Closed Base29 closed 6 years ago

Base29 commented 6 years ago

Hello Guys ... I want to use Fontawesome Icons for the button text ... I have done this by installing a Fontawesome module and in the text: parameter of button options I passed the instance of the fontawesome module like this

const swipeoutBtns = [
    {
        onPress: () => {
            console.log("Item Deleted");
        },
        text: <FontAwesome style={{fontSize: 26, color: '#FFFFFF'}}>{Icons.trash}</FontAwesome>,
        backgroundColor: '#DC0404'
    }
]

Though I have the icon there instead of text but I am getting a warning shown in this screenshot http://prntscr.com/hknb7u ... how can I fix this ? is there a option that I can use ? Let me know ... Thanks

nicolasbrugneaux commented 6 years ago

Since the maintainer doesn't seem to want to help you, I can try to give you a piece of advice.

You should use the component props, not the text props if you want to provide custom element.

Base29 commented 6 years ago

@nicolasbrugneaux ... It worked like a charm ... May be the reason that the maintainer did not replied because I forgot to add a label "Help Wanted" in my post ... Anyways thank you for the help