Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use svg files to replace the heading/trailing icons? #245

Closed
YangRongAtGit opened this issue Sep 14, 2021 · 1 comment
Closed

How to use svg files to replace the heading/trailing icons? #245

YangRongAtGit opened this issue Sep 14, 2021 · 1 comment
Labels
bug Something isn't working v2 Bug fixed / feature added in v2

Comments

@YangRongAtGit
Copy link

Hello,
I am trying to use some custom icons for replacing heading/trailing icons. I have something like

const errIcon: ImageSourcePropType = {
  uri: '../assets/tick.svg'
};

export const toastConfig = {
  error: ({ text1, props, ...rest }) => (
    <BaseToast
      {...rest}
      leadingIcon={errIcon}
      contentContainerStyle={{ paddingHorizontal: 15 }}
      text1Style={{
        fontSize: 15,
        fontWeight: '400'
      }}
      text1={text1}
    />
  )}

But the icons do not show in the toast. My question is: what is the correct way to use SVG images in the toast?

@YangRongAtGit YangRongAtGit changed the title How to use a svg file to replace the heading/trailing icons? How to use svg files to replace the heading/trailing icons? Sep 14, 2021
@calintamas calintamas added bug Something isn't working v2 Bug fixed / feature added in v2 labels Oct 21, 2021
@calintamas
Copy link
Owner

In v2.0.0, leadingIcon, trailingIcon props were replaced with renderLeadingIcon, renderTrailingIcon to gain total control over the icon layout / behavior. Read the complete changelog.

If you find any issues with the v2 implementation, feel free to reopen this issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2 Bug fixed / feature added in v2
Projects
None yet
Development

No branches or pull requests

2 participants