Skip to content

Type for key with suffix

Is it possible with typescript to define that keys of state should be lowercase + some string? Answer UPDATE FOR TS4.8 AND ABOVE This now works, as-is!! As of TypeScript 4.8 there is now support for using the intrinsic string manipulation types with wide types like string. This was implemented in microsoft/Ty…

React not getting different images for same URL

I am making a users page with arbitrary data and noticed that since the image URL is the same (https://source.unsplash.com/random) the image is the same. How can I prevent this? Answer That is because, your browser caches your url and assumes you are hitting the same url so it populates previous result. Add a…