3 ms·
Here is our React/Bootstrap modal component: https://github.com/gitboard/gitboard/blob/master/src/js/components/generic/modal.jsx https://github.com/gitboard/g
by ThePhysicist 11y ago
Here is our React/Bootstrap modal component:
https://github.com/gitboard/gitboard/blob/master/src/js/components/generic/modal.jsx https://github.com/gitboard/gitboard/blob/master/src/js/comp...
Initially we used a 3rd party component but we finally wrote this much simpler version. It uses only React state variables to show/hide the modal and does not require any jQuery or Bootstrap JS to work (both of which can cause problems when mixing them with React). Feel free to reuse this code, the whole repository (Gitboard) is currently licensed under AGPL but we would be happy to provide e.g. an MIT license for the components or even make it public domain (as this is hardly more than a code snippet).
- zackify 11y agoHey, creator of ReactJSNews here. Feel free to add it to the post and send a pull request! https://github.com/Legitcode/ReactJSNews/blob/master/posts/2015-07-29-modals-in-react.md https://github.com/Legitcode/ReactJSNews/blob/master/posts/2... Anyone is welcome to write a post on the site!
- ThePhysicist 11y agoCool, will do that!
- fredoliveira 11y agoIf you ever extract your component into its own repository, we'd love to have you submit it to http://react.parts http://react.parts!
- nicksellen 11y agoit declares jquery as a requirement but doesn't actually use it - https://github.com/gitboard/gitboard/blob/master/src/js/components/generic/modal.jsx#L10 https://github.com/gitboard/gitboard/blob/master/src/js/comp...
- ThePhysicist 11y agoGitboard as a whole uses jQuery, but not the component. I will have to clean up the code a bit it seems, will do that in the coming days and publish the component.