Closed dmikester1 closed 3 years ago
Hi @dmikester1 The offset and containerStyle options should be passed to Provider as written in this part of docs
When you pass them in to the provider like that, that sets those options for the entire app right? Is there a way to customize them for each seperate alert?
Try to create your own AlertTemplate with custom options. I think that would help
So what am I doing wrong here? The offset works, but the position and the containerStyle do not work.
// optional configuration
const options = {
// you can also just use 'top center'
position: positions.TOP_CENTER,
timeout: 50000,
offset: '56px',
containerStyle: { width: 'max-content' }
};
ReactDOM.render(
<AlertProvider template={AlertTemplate} {...options}>
<App />
</AlertProvider>,
document.getElementById('root')
);
I am trying to run
alert.show()
in my component with some custom options. But the offset and containerStyle options don't seem to be taking for some reason. My code:The text in the alert was wrapping and looked funny, so I wanted the width to be
max-content
. It seems to be defaulting to 300px for some reason.