This is example code for the article series
The code itself does not much: It exports a React component (ExampleComponent
) that uses a custom hook which returns the props that have changed before the last re-render. The hook is also exported separately (usePropsThatChanged
). It returns a Set
. An array would work the same way but we use a Set for illustrating transpiling/polyfilling of ES2015+ features.
Throughout the article series I present common alternatives to solve the same task. For instance, transpiling modern code to incapable targets with Babel or with the TypeScript compiler. I decided to show all of these variants here in this repository by utilizing branches. The master
branch will reflect my personal choices while other, aptly named branches will show configurations for other combinations of tools.
The following table will list them.
tool / feature | master |
typescript |
typescript-tsc |
node-esm |
---|---|---|---|---|
Transpiling with Babel | x | x | x | |
TypeScript | x | x | ||
Transpiling with tsc |
x | |||
Signal NodeJS ESM | - | - | - | x |