Eckhart Tolle frequently reminds us, "The primary cause of unhappiness is never the situation, but your thoughts about it."
Tuesday, October 22, 2024
Friday, October 18, 2024
Friday, September 27, 2024
react ag-grid note 4 Avoid Wasted Renders
100% React Rendering, Avoid Wasted Renders
https://www.youtube.com/watch?v=oAQ5vavDupU&list=PLsZlhayVgqNwHNHeqpCkSgdRV08xrKtzW&index=4
const MyComp = params => {
const renderCountRef = useRef(1);
return (
<>
<b>({renderCountRef.current++})</b> {params.value}
</>
);
};
cellRenderer: memo(MyComp)
react ag-grid note 2 ag-grid-enterprise
react ag-grid note 2
react ag-grid note 2
https://www.youtube.com/watch?v=pKUhYE1VTP4&list=PLsZlhayVgqNwHNHeqpCkSgdRV08xrKtzW&index=2
npm install --save ag-grid-enterprise
import 'ag-grid-enterprise'
ag-grid-enterprise, ag-grid-community and ag-grid-react needs to be the same version to make ag-grid-enterprise work
enableRowGroup: true
rowGroupPanelShow='always'
Only shows at F12 developer tool * If you want to hide the watermark please email info@ag-grid.com for a trial license key.
Thursday, September 26, 2024
react ag-grid note 1
react ag-grid note 1
https://www.youtube.com/watch?v=6hxbPqziELk&list=PLsZlhayVgqNwHNHeqpCkSgdRV08xrKtzW&index=1
npx create-react-app my-app
cd my-app
npm install --save ag-grid-react
npm run start
App.js
App.css
Tuesday, September 17, 2024
CSS note from The complete 2024 web development bootcamp
1.
p {
color: red;
}
.note {
font-size: 20px;
}
#id-selector-demo {
color: green;
}
li[value="4"] {
color: blue;
}
* {
text-align: center;
}
https://appbrewery.github.io/box-model/
2. Combining CSS Selectors
<p>Yellow Text</p>
<div class="box inner-box">
<p>White Text</p>
</div>
p {
color: yellow;
}
.inner-box p {
color: white;
}
Descendant = Apply to all offsprings of left side
selector selector { ... }
Group = Apply to both selectors
selector, selector { ... }
Child = Apply to direct child of left side
selector > selector { ... }
Chaining = Apply where all selectors are true
selectorselector { ... }
3. CSS positioning
https://appbrewery.github.io/css-positioning/
4.
display: none/inline/block/inline-block/grid/flex
Monday, September 9, 2024
JavaScript definitive guide note
1. == equality operator is deprecated. Use ===
2. Use const and let to define variable (or with var in older JavaScript code)
3. Expression a??b is equivalent to: (a!==null&&a!==undefined)?a:b