If you’ve ever worked with a multi-page React app, you will invariably run into the dreaded warning in your console:
Warning: Can't perform a React state update on an unmounted component.
The most common cause of this warning is when a user kicks off an asynchronous request, but leaves the page before it completes. I especially wanted to know how to do this with hooks, because hooks are awesome.
I wanted to know how to avoid this classic React warning - here’s my solution.
To explain the above code snippet, imagine we have a sample component that simply displays a counter, and a button to increment the counter.
When we click the button, it fires off
someLongRunningProcess() - this could be a backend operation or whatever. Use your imagination.
someLongRunningProcess() has completed, we make sure we’re still mounted via the
componentIsMounted variable! If the component is still mounted, we can modify the state, no problem. If it’s not mounted - hey, that’s alright, we won’t touch the state.
This will dodge that nasty React warning! Have fun!
I just developed a nifty online tool that might help you guys with Seraphon battles in the future. As a Seraphon player, I was always stressed that I was forgetting to do things in the right phase.
So, I developed AoS Reminders. It only has Seraphon for now . I will probably add Sylvaneth next.
Basically, you add your units, battalions, and artifacts, and you will get an ordered list of what abilities to use during which phase. It’s pretty specific - for example, if you add Ripperdactyls, it will remind you to place a Bloat Toad on Turn One - Hero Phase.
Please give it a whirl and let me know if you enjoy it! I would LOVE some feedback and critiques! I am looking to expand this to other armies eventually, but figured my own Seraphon (of which I have over 4k points worth :p) would be a good start.
Here’s a look at the UI:
P.S. it is print-friendly! When you hit print, all of the fancy UI elements are stripped out and you get a list like so:
This was developed using React/TypeScript, for those who might care about such things. :) Check out the code here: Github
Feel free to fork it and add your own army! I will gladly accept contributions.
Here are some pictures of my newly created (and thoroughly magnetized) Warhammer: Age of Sigmar Seraphon Stegadon/Engine of the Gods model.
This miniature boasts sixteen magnets.
The model can be converted between three configurations using magnets:
By adding magnets all over the model, I was able to achieve a dual-function model, something I’m quite proud of.
This was my first time magnetizing a model. I learned a lot. I’m writing this blog mostly as a way to recap what I’ve learned.
Here are some pictures from the build:
I can’t wait to use this guy in an upcoming battle. Being able to alternate between model types will be awesome for future replayability.
While the model technically is lacking an Engine, I’ve made up for that with lore! You see, the Engine on this particular model broke down many years ago and was discarded. The mighty Skink Priest was so clever and determined to succeed that he managed to channel the spirit of the Engine through himself.
So, the Skink Priest == Engine, on this model. Don’t think too much about it.
Some great photos of my Warhammer: Age of Sigmar Seraphon models. All of the photos were taken by Nicole Griffin. The desert scene was edited and put together by Fulton Griffin.
I am extremely happy with how my Kroxigor’s back scales came out! The Sunblood’s mace and shield are given the glowing effect with a liberal application of polyurethane.