You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the index.ts files rexports the InvIew and useInView function. This should allow the consumer to import either, and have the other removed when bundling.
However, this doesn't appear to happen when building for production. Importing either, results in all the exports being included.
Look at https://bundlephobia.com/package/[email protected] where all the exports have the same size (1.8kB)
The text was updated successfully, but these errors were encountered:
Turns out the issue was caused by static values (displayName and defaultProps) on the InView component. These were extracted by babel, and in turn prevents it from being excluded from the bundle.
Tree shaking was broken due to the InView component.
This fixes it, and adds the size-limit package to better keep track of the size going forward.
This resolves#544
BREAKING CHANGE: Can no longer do the default import of InView
Currently the
index.ts
files rexports theInvIew
anduseInView
function. This should allow the consumer to import either, and have the other removed when bundling.https://github.com/thebuilder/react-intersection-observer/blob/master/src/index.tsx#L3-L4
However, this doesn't appear to happen when building for production. Importing either, results in all the exports being included.
Look at https://bundlephobia.com/package/[email protected] where all the exports have the same size (1.8kB)
The text was updated successfully, but these errors were encountered: