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

Custom / Position #316

Open
mweel1 opened this issue Oct 22, 2023 · 1 comment
Open

Custom / Position #316

mweel1 opened this issue Oct 22, 2023 · 1 comment
Labels
question Further information is requested

Comments

@mweel1
Copy link

mweel1 commented Oct 22, 2023

Is this supposed to work?

The position isn't taking.

const success = (message: string) => {
  toast.custom((t) => {
    t.position = "bottom-center";
    return (
      <Toast type="success">
        <>{message}</>
      </Toast>
    );
  });
};

It doesn't seem to.

@timolins
Copy link
Owner

timolins commented Oct 22, 2023

No, this won't work.

You can pass the position as second argument.

toast.custom("Custom", {
  position: "bottom-center"
})

If you are trying to render custom content inside a success toast, there is no need for toast.custom(). You could do this:

toast.success(<h1>Custom Content</h1>, {
  position: "bottom-center"
})

@timolins timolins added the question Further information is requested label Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants