stratiformltd / react-loadable-visibility

A wrapper around react-loadable and @loadable/component to load elements once they are visible on the page.
BSD 3-Clause "New" or "Revised" License
1.01k stars 31 forks source link

no declaration file #14

Closed BernardA closed 5 years ago

BernardA commented 5 years ago

Getting the error below on Visual Studio Code when attempting to use react-loadable-visibility.

I was already using react-loadable without this issue.

 Could not find a declaration file for module 'react-loadable-visibility/react-loadable'. '/Users/BAMAC/Sites/pwa3/node_modules/react-loadable-visibility/react-loadable.js' implicitly has an 'any' type.

I am using npm (6.4.1), react(16.5.2) and webpack(3.8.1) versions.

For whatever it's worth, here's some excerpts of app.js code:

 ......
 import Loadable from 'react-loadable';
import LoadableVisibility from 'react-loadable-visibility/react-loadable';
import PrivateRoute from './auth/auth';
import Header from './pages/common/header/';
import { Loading } from './tools/functions';

const HomePage = Loadable({
    loader: () => import('./pages/home/'),
    loading: Loading,
    delay: 100
});

const Footer = LoadableVisibility({
    loader: () => import('./pages/common/footer/'),
    loading: Loading,
  })

Additionally, I do have an issue with react-loadable not retrieving files from cache when used with service-worker. I could not find where to report on react-loadable's repository. I did try SO, without success.

tazsingh commented 5 years ago

Closing this issue as it's a duplicate of #13 with less information. Github was having some issues which could've caused the other issue to disappear causing a repost of this. Feel free to leave any additional comments on #13.