Code Monkey home page Code Monkey logo

react-lazily's Introduction

react-lazily's People

Contributors

jlarky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-lazily's Issues

can you lazy load npm modules

this is fantastic when using your own components, but if I wanted to lazy load a npm package component it doesn't seem to be able to lazy load that in.

for example, I have the react-tooltip npm package component that's added based on a condition

{activity.host?.following && (
    <Tooltip id="following" place='left' />
)}

so I'd like to lazy load it in, normally it would be

import { Tooltip } from 'react-tooltip';

however, if I use lazily load instead

const { Tooltip } = lazily(() => import("react-tooltip"))

The component doesn't show, but VSCode shows that it knows the component location in the npm packages, so not sure why this wouldn't work ?

dose or can this package support lazily loading other npm packages?

Possible to use without suspense?

I'm getting lots of these errors, anyway I can get around without having to wrap every lazy loaded component with a suspense component?

Error: A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.

Compiling very slow if used much more

After using lazily to import component, I found that the website compiles very slow running npm start and npm run build. Also, I used source-map-explorer to check the bundle file size, its increase 5x.

Does anyone have solution?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.