question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing exported components, hooks, utils, and types

See original GitHub issue

Hi!

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:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mlaursencommented, May 18, 2020

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 the navItems 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.

1reaction
mlaursencommented, Apr 15, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found