Missing exported components, hooks, utils, and types
See original GitHub issueHi!
While playing with the lib, I noticed some absent exports to re-use. Why not to export as much as possible to be able extends on any level? Also, what about to use named exports (instead of defaults) to simplify index-exports? So, instead of
export { default as useLayoutNavigation } from "./useLayoutNavigation";
just export all:
export * from "./useLayoutNavigation";
I made some refactor for example on layout component, check it please, and if there is no objections from you, may be I can help with refactor.
https://github.com/aleksanderd/react-md/commit/c326fb2066a75d438f6466e55010520c2f5a29bb
Thank you!
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Types lost in version 6 · Issue #2073 · react-hook-form/react ...
If you don't export the internal typings, that's one thing but not providing the typings for exported components/hooks/methods is a big issue.
Read more >Attempted import error/ App' does not contain a default export ...
In Nodejs, to use a variable or a function in another file, you have to export them. And we have two type export....
Read more >How to Build Your Own React Hooks: A Step-by-Step Guide
First, we'll create a new file . js in our utilities (utils) folder, the same name as the hook useWindowSize . I'll import...
Read more >How to refactor React components to use Hooks
In this article, we'll cover some generic issues with refactoring that apply to a wide variety of application types, starting with the basic ......
Read more >Type Reference - JavaScript. Flow
A reference for all the utility Flow types exported by the React module.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I looked over this package again while writing the changelogs and realized it was never finished and was just hacked together to get the documentation site able to render. The latest commit (0dec760) should address some of the missing customization and I tried out the new
<name>Props
pattern which seems to work out pretty well. All the constants, types, utils, and additional components should now be correctly exported as well as some other few changes.I’ll be updating the documentation a bit within the next few days, but the nice thing about these changes is that the
Layout
no longer requires thenavItems
and can be rendered as just a simple layout instead of a navigable layout. It also fixed some of the keyboard focus-loss and keyboard trap behavior that shouldn’t have been there.Those changes sound good to me since it could also be applied to the
<main>
component and since there are too many props being passed down now. I think I’ll eventually apply this to other packages/components as well that have sub-components.