skeleton-ghost-loader 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skeleton-ghost-loader",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Tailwind-based structure preserving skeleton loader for React",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -20,3 +20,5 @@
20
20
  "react-dom": ">=16.8"
21
21
  }
22
22
  }
23
+
24
+
@@ -1,13 +1,14 @@
1
1
  import React from "react";
2
- import { replaceWithSkeleton } from "../utils/replaceWithSkeleton";
2
+
3
3
  import Skip from "./Skip";
4
+ import { ReplaceWithSkeleton } from "../utils/ReplaceWithSkeleton";
4
5
 
5
6
  const Skeleton = ({ loading, children, pulse = true }) => {
6
7
  if (!loading) return children;
7
8
 
8
9
  return (
9
10
  <>
10
- {replaceWithSkeleton(children, { pulse })}
11
+ {ReplaceWithSkeleton(children, { pulse })}
11
12
  </>
12
13
  );
13
14
  };
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import SkeletonItem from "../components/SkeletonItem";
3
3
 
4
- export function replaceWithSkeleton(node, options) {
4
+ export function ReplaceWithSkeleton(node, options) {
5
5
  const { pulse } = options;
6
6
 
7
7
  // Text node
@@ -38,7 +38,7 @@ export function replaceWithSkeleton(node, options) {
38
38
  return React.cloneElement(node, {
39
39
  className,
40
40
  children: React.Children.map(children, (child) =>
41
- replaceWithSkeleton(child, options)
41
+ ReplaceWithSkeleton(child, options)
42
42
  ),
43
43
  });
44
44
  }