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

When using react-s-alert in project, double alerts are shown when react-bootstrap-table are mounted. #1771

Closed
widdde opened this issue Nov 22, 2017 · 5 comments

Comments

@widdde
Copy link

widdde commented Nov 22, 2017

Hello!
We have some trouble with React-bootstrap-table in our project. We're using react-s-alert-component internally in our project and in all views that we are using react-bootstrap-table, we get 2 alerts when calling Alert.info (for example).
I think react-bootstrap-table use react-s-alert internally and somewhere define an global < Alert > and because of this, we get alerts twice.
Can you provide a boolean in options or something, where you then can disable the global < Alert > internally in react-bootstrap table and then depend that it is defined in the parent project?

I think this is also an issue when you have 2 react-bootstrap-tables mounted at the same time..
We're not using tables in all our views, so we can not depend that we always have a react-bootstrap-table present where < Alert > is defined, so we need a way to not mount the < Alert > in react-bootstrap-table.

Thanks in advance.
PS. The version of react-s-alert you are using in react-bootstrap-table does use Object.Assign() which is not supported in IE11. When trying to show an alert in IE11 the application fails. Just a hint to also update react-s-alert in your project to a newer version.We have polyfilled this in our project at the moment and are using a newer version of react-s-alert where this is fixed, but it is not fixed in the version that react-bootstrap-table are using.

@AllenFang
Copy link
Owner

@widdde yes, I know this issue, if we have more than one table, will popup multiple alerts. That's why I create react-bootstrap-table2 and remove the alert dependency from react-bootstrap-table2.

However, I already stop to implement the new feature on react-bootstrap-table, but your suggestions is good, I'll give a props to not render the Alert inside the react-bootstrap-table and also update

Thanks

@widdde
Copy link
Author

widdde commented Nov 26, 2017

Thanks for the reply and fix :)
We will migrate to React Bootstrap table2 when it is available :)

@AllenFang
Copy link
Owner

@widdde sure, but it still need the time to develop ;)

@AllenFang
Copy link
Owner

@widdde fixed on v4.2.0 add renderAlert={ false } on BootstrapTable. Also update the version of react-s-alert. thanks

mrijke added a commit to mrijke/DefinitelyTyped that referenced this issue Nov 29, 2017
react-bootstrap-table 4.2.0 added the renderAlert prop to disable rendering of the react-s-alert <Alert> component.

Reference: AllenFang/react-bootstrap-table#1771
@widdde
Copy link
Author

widdde commented Dec 4, 2017

Thank you @AllenFang !
Will test 4.2.0 asap! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants