Modals in React
reactjsnews.com
reactjsnews.com
TL;DR for the React/Flux team if you read this: please update the Todo tutorial!
Also more on topic, I really like the material-ui project, and it's modals are quite nice.
PS somebody posted a link to my post, maybe it's better to continue there if you're interested in the discussion: https://news.ycombinator.com/item?id=9967220
http://www.drewdevault.com/2015/07/20/A-practical-understand...
I'm coming from MVC where actions are the methods of controllers. But in Flux they are objects passed to the dispatcher and the functions who create them aren't actions, but actions creators.
But I have to say, I got my first impression of React/Flux from a project that was already using it (Redux) in production with a big chunk of integration code around it.
This article is really shallow so I'd just like to suggest you look at the code for the Rackt modal- it takes the children you pass it and renders them in a new React container, a pattern it calls a "portal". That sidesteps all of the issues with rendering a modal in the middle of your markup (CSS cascading mainly). I thought that was really clever when I saw it.
Not sure where it should fit in the current UI? Oh just throw it in a modal, restricting the user's ability to interact with anything else on the page, requiring an extra click to close the modal.
I'm sure there are good times to use them, but typically I find they are restrictive.
They are particularly ineffective for protecting the user against errors, except on systems which use them very sparingly (such as in the web, thanks to browsers adopting non-modal bars for most warnings and search actions.) We older netizens remember the nightmare that was every other web page throwing a modal alert(); that blocked the browser on all the open tabs.)
[1] https://en.wikipedia.org/wiki/Modal_window#Design
[2] https://en.wikipedia.org/wiki/Mode_(computer_interface)#Asse...
On the other hand, I don't know much about them so I don't even get the idea that I could use them in a UI design.
Simply put, blocking the UI is hostile.
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).
Getting tired of modals (especially for login/signup) that doesn't have a route to it.
Settings, so you can send it to your parents so they can fix that shitty notification spam they got going, etc.
That's just my take on it.