The official course boilerplate contains a branch including the Stats panel if you need.
You can clone the boilerplate into a new folder somewhere and checkout the stats branch.
git clone https://github.com/Sean-Bradley/Three.js-TypeScript-Boilerplate.git
cd Three.js-TypeScript-Boilerplate
git checkout stats
npm install
npm run dev
Error : This module is declared with 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
@types/three@0.150.0 and several versions later changed how stats.module.js was being referenced. Depending on the version of Threejs you are using, you can add "allowSyntheticDefaultImports": true to your tsconfig.json to counteract the error. This fix no longer seems to be necessary since Three r154.
And we also now need to instantiate using the syntax,
conststats=newStats()
In previous versions of @types/three, we could use the syntax,
conststats=Stats()
'new' expression, whose target lacks a construct signature, implicitly has an 'any' type
If using @types/three@0.148.0 or earlier with stats.module, instantiating a new Stats() (using the new keyword) would cause the error new' expression, whose target lacks a construct signature, implicitly has an 'any' type since stats is exported as a function and not a class.
In @types/three@0.148.0 and earlier, you could use the syntax,
conststats=Stats()
In @types/three@0.149.0 and later, you now need to add "allowSyntheticDefaultImports": true to your tsconfig.json, instantiate stats using the syntax,