Monday, December 09, 2019

The match condition of react useEffect

From https://lukaszmakuch.pl/post/react-hooks-oops-part-2-effect-runs-multiple-times-with-the-same-dependencies/


useEffect(fn, deps);
 
fn is the function, and deps is an array of values it depends on. Every time the component renders, React checks if all the values in the deps array are still the same. If any of them has changed since the last render, fn is run again.

So, in the deps array, any one of variables changed, then the function fn inside useEffect run.

Tuesday, November 19, 2019

React diagram

Evaluating two react flow diagrams

react-flow-chart
It looks a little bit odds, the arrows are on the top/bottom of diagram from the demo.

react-diagrams
From the demo see a lot more complicated cases.
To see demo,  run
 cd packages/diagrams-demo-gallery && yarn run start


Monday, November 11, 2019

npm ERR! missing:

Part of error messages

...
  +-- terser@3.17.0 deduped
  +-- v8-compile-cache@2.1.0 deduped
  `-- ws@5.2.2 deduped

npm ERR! missing: mkdirp@0.5.1, required by node-pre-gyp@0.12.0
npm ERR! missing: minimist@0.0.8, required by mkdirp@0.5.1
npm ERR! missing: minimatch@3.0.4, required by ignore-walk@3.0.1

...

Then I run
npm update -g
that is suggestion from stackoverflow.

But, still not fix.


NPM error : UNMET DEPENDENCY

It's right in that message, it says which deps you're missing

Monday, November 04, 2019

Markdown multple level list with number and alpha index in the different level

According stackoverflow, only Pandoc can do that.

Install PostgreSQL

Download from https://www.enterprisedb.com/thank-you-downloading-postgresql?anid=1256972

Use port 5432

Admin tools