Fork me on GitHub
#reagent
<
2021-07-07
>
Mitul Shah16:07:59

hi! i’m trying to find the equivalent of the following to apply the toastOptions

<Toaster position="bottom-left"
  toastOptions={{
    className: 'bg-dark',
  }}
/>
but not seeming to have luck with this
[:> Toaster :position "bottom-left" :toastOptions {:className "bg-dark"}]

sansarip17:07:54

Properties can be passed as a map, like so:

[:> Toaster {:position "bottom-left :toastOptions #js {:className "bg-dark"}}]
You can also write the :toastOptions key as :toast-options as Reagent will convert kabob-case keys to camel-case behind the scenes (in property maps). #js is a cljs literal that can create a javascript object for you which is probably what Toaster expects for the value of :toastOptions.

Mitul Shah17:07:48

No luck with that sadly, odd https://react-hot-toast.com/docs/styling it doesnt seem like i’m off on anything

Mitul Shah17:07:23

this works, so i’m close :thinking_face:

:toastOptions #js{:style #js{:padding "200px"}}

Mitul Shah17:07:10

nvm! thank you your solution works. it’s just tailwind acting up on my end.

🎉 2