allenai / pdf-component-library

51 stars 5 forks source link

Move useContextProps() to Context files #139

Closed pauls-ai2 closed 2 years ago

pauls-ai2 commented 2 years ago

This PR moves the use*ContextProps() functions from ContextProvider into their own Context files. This way, the typing can be self contained within a single file, and it reduces the knowledge required for ContextProvider.

The unit tests have also been refactored so each context is tested separately from the ContextProvider (which now only tests that it creates contexts, not what the contexts do).