I'm trying to figure out the best way to extract functionality from a big component into separate files, so that it would be easier to read and maintain. I think it makes a lot of sense to pair the logic and component into the same file, since they are deeply coupled together anyway.
I simplified the example here, but please imagine that both the custom hook logic and the component are complicated enough that it makes sense to not just put them directly inside the List component.
Version 1 is the traditional way of doing this, version 2 is what I came up with. What I like about version 2 is that it keeps the internals of the hook hidden and the api to the the component using it is much cleaner. Are there any downsides?
I added option 3, where we expose props together instead of 1 by 1. Thanks Alexander for the suggestion.