answer:
const setParentAsActive = (node: any) => {
if (node) {
node.parentNode.className = node.className
answer:
const setParentAsActive = (node: any) => {
if (node) {
node.parentNode.className = node.className
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.
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.
prepare
const httpCodeFetch = async ({ url, config = initialConfig }) => {
const res = await fetch(url, config)
if (res.status === 204) return {}
if (res.ok) {
return res.json()
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:
https://medium.com/inturn-eng/naming-styled-components-d7097950a245
https://twitter.com/thekitze/status/989110942096117768
use *
wildcard
const App = () =>{ | |
const [conunt,setConunt] = useState(1) | |
return ( | |
<div> | |
{Array(conunt).fill(<RepeatCompnent/>)} | |
</div> | |
) | |
} |
function blobToDataURI(blob, callback) { | |
const reader = new FileReader() | |
reader.readAsDataURL(blob) | |
reader.onload = function (e) { | |
callback(e.target.result) | |
} | |
} |
yarn add -D tailwindcss twin.macro autoprefixer babel-plugin-macros styled-components