A modern alternative to Hooks