Skip to content

Instantly share code, notes, and snippets.

View wildfrontend's full-sized avatar
something need to do

louis.luo wildfrontend

something need to do
  • DG
  • Taichung
View GitHub Profile
wildfrontend /
Last active September 30, 2020 03:54
How to use bulma tabs active class name on the parent element with React router



  const setParentAsActive = (node: any) => {
    if (node) {
 node.parentNode.className = node.className
wildfrontend / why we dont need to use
Last active September 11, 2020 15:21
why we dont need to use `npm install --save-dev`

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.


  • rewrite fetch to catch httpcode
const httpCodeFetch = async ({ url, config = initialConfig }) => {
    const res = await fetch(url, config)
    if (res.status === 204) return {}
    if (res.ok) {
 return res.json()


  1. add in
  2. add Global 404
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:
wildfrontend / AppendComponent.js
Created July 16, 2020 05:44
create dymanic component
const App = () =>{
const [conunt,setConunt] = useState(1)
return (
function blobToDataURI(blob, callback) {
const reader = new FileReader()
reader.onload = function (e) {
wildfrontend /
Created June 5, 2020 15:09
tailwind.css with css-in-jss , react setup