https://medium.com/inturn-eng/naming-styled-components-d7097950a245
https://twitter.com/thekitze/status/989110942096117768
use *
wildcard
- for
- prettier code style
https://medium.com/inturn-eng/naming-styled-components-d7097950a245
https://twitter.com/thekitze/status/989110942096117768
use *
wildcard
Hey guys, so today I've came across this exact same issue and I was able to get something working to render a "global not found" component, while keeping the benefits of sharing some UI within a "parent" route. I wanted to share this with you, in case you find this useful for your case :)
Consider the routes I need to support:
prepare
const httpCodeFetch = async ({ url, config = initialConfig }) => {
const res = await fetch(url, config)
if (res.status === 204) return {}
if (res.ok) {
return res.json()
Why closing a page does not unmount the component
Closing the page will actually discard the main process/thread which handles the rendering of the web page. In that case,
there is actually no way of calling the unmounting method since the thread which calls that method is discarded.
As of NPM 5, saving is done by default
--save-dev is only needed if we’re building a node app;
since we output minified JS for production via npm run build, everything is a dev dependency,
so it doesn’t actually matter in practice whether modules are added to dependencies or devDependencies in package.json.
answer:
const setParentAsActive = (node: any) => {
if (node) {
node.parentNode.className = node.className