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

Typescript issue in Banner component when trying to customize an action button

Open gevorgsahakyann opened this issue 6 years ago • 5 comments

Environment

"react-native": "0.61.5", "react-native-paper": "^3.6.0", "typescript": "^3.7.5"

Description

I tried to customize the action button for the Banner component and got the typescript issue. Can't pass other properties except for the label and onPress.

Screen Shot 2020-02-14 at 18 21 07

Please set the button's typescript type for banner actions. Screen Shot 2020-02-14 at 18 20 43

gevorgsahakyann avatar Feb 14 '20 15:02 gevorgsahakyann

I noticed the same issue, however, I was wondering: Would it make sense to have the same kind of API as we have for Card?

I think it would be more flexible. But maybe I am missing something / it's not really a good fit / we could just use the Card components...

<Banner>
  <Banner.Content>
    There was a problem processing a transaction on your credit card.
  </Banner.Content>
  <Banner.Actions>
    <Button>Fix it</Button>
    <Button>Learn more</Button>
  </Banner.Actions>
</Banner>

kamui545 avatar Mar 04 '20 06:03 kamui545

Hello 👋, this issue has been open for more than 2 months with no activity on it. If the issue is still present in the latest version, please leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution on 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 the issue.

github-actions[bot] avatar May 04 '20 00:05 github-actions[bot]

I am having the same issue.

reutg avatar Oct 04 '20 12:10 reutg

Experiencing this exact same issue. Can we reopen this issue please?

mesamhaid avatar Oct 29 '20 20:10 mesamhaid

I think the proposal from @kamui545 would work very well here.

mister-conor avatar Dec 09 '20 15:12 mister-conor