React-native-paper: Avatar.Image should take standard Image props

Created on 15 May 2019  路  6Comments  路  Source: callstack/react-native-paper

Describe the feature

Standard Image props like onError, onLoad, accessibilityLabel, etc. should be able through to the Avatar.Image component.

Motivation

One example is, I'd like to fallback to Avatar.Text if loading an image via URI fails.

Off-topic question: I tried reimplementing Avatar.Image myself since it's so simple, but whenever I use my own component in a FlatList, it terribly lags after about 60 items. When I use Paper's Avatar.Image, everything renders nice and speedily. Is there anything different Paper is doing under the hood to optimize performance? I don't see anything obvious.

Stale

Most helpful comment

Would love to make a PR. Should the props be declared in the component or can they be passed through with a spread operator? I'd imagine the latter to be future proofed, right?

All 6 comments

Standard Image props like onError, onLoad, accessibilityLabel, etc. should be able through to the Avatar.Image component.

PR welcome

Is there anything different Paper is doing under the hood to optimize performance

Nope

Would love to make a PR. Should the props be declared in the component or can they be passed through with a spread operator? I'd imagine the latter to be future proofed, right?

Spreading rest of the props is fine I think

Spreading rest of the props is fine, but I think define exactly props is better.
With the support of IDE, we don't need to read Official API which props have defined.

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.

So I guess this didn't happen @satya164?

Was this page helpful?
0 / 5 - 0 ratings