DEV Community

terrierscript
terrierscript

Posted on

2 2

loadable-component is awesome library for React code-splitting / dynamic-import

I found good React code-splitting library and this article recooment this : loadable-components.


When I want to use dynamic import and code spliting in React application, I must implement wrapper and it's messy.

In React document's code splitting section use react-loadable.
This is good library, but sadly this repository is disabled issue.

I watched the React document's issue and found this issue and loadable-component.

https://github.com/reactjs/reactjs.org/pull/573

I felt "Ah, that is great library !"
Below is loadable-component's my favorite points.

Favorite point: Concept

From motivation

main goal: reducing API in order to make it as easier as possible for the developer

I saw the sample and felt that "this is certainly easier than other libraries!"

img

Favorite point: Good README (documentation).

loadable-components's README is listed methods and functions to need, clearly and exhaustive.

FYI: I felt most attractive function is Prefetch hover. react-loadable has this function too, but I couldn't found that easily.
(Because react-loadable's readme has some very big images..)

Favorite point: Clean Code & Testing

loadable-componet has many function and I predicted code is to hard.
But I suprised that keep very clean code when watch loadable-component source code.
If I got problem, I will able to resolve or post pull request.
Of course there are also tests.

Favorite point: Open issue

Library's owner can select disable or enable issues.
But I want to choose library that accept isses.
Issues is can post my issue and also function as great knowledge bank.

Conclusion

I favorited loadable-component.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more