New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

guide-eazy

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

guide-eazy - npm Package Compare versions

Comparing version 0.0.15 to 0.0.16

2

package.json

@@ -5,3 +5,3 @@ {

"types": "dist/types/index.d.ts",
"version": "0.0.15",
"version": "0.0.16",
"description": "Guide for React",

@@ -8,0 +8,0 @@ "author": "闲D阿强",

@@ -22,2 +22,80 @@ # Guide-Eazy - React 引导库

## demo
就做两件事
- 创建一个 Provider
```jsx
"use client";
import { Card } from "antd";
import {
GuideCoreProvider,
GuideHook as GuideHookBase,
useGuideRef,
} from "guide-eazy";
import "guide-eazy/dist/style.css";
import { PropsWithChildren, useEffect } from "react";
export type GuideId = "start" | "step1_1" | "step1_2" | "step1_3";
const GuideProvider = ({ children }: PropsWithChildren) => {
const guideIns = useGuideRef();
useEffect(() => {
guideIns.current?.drive();
}, []);
return (
<GuideCoreProvider<GuideId>
guideIns={guideIns}
steps={{
showProgress: true,
steps: [
{
id: "start",
customPopRender({ api }) {
return (
<Card
style={{
position: "relative",
bottom: 50,
padding: "32px",
fontSize: "30px",
fontWeight: "bold",
}}
onClick={() => {
api.setGuideIndex(1);
}}
>
欢迎来到闲D岛🏝️
</Card>
);
},
},
],
}}
>
{children}
</GuideCoreProvider>
);
};
export const GuideHook = GuideHookBase<GuideId>;
export default GuideProvider;
```
- 然后就是“插眼”
```jsx
function TestNode({ id, item }: NavItemProps) {
return (
<Button>
...
<GuideHook readyId={"step1_1"} />
...
</Button>
);
}
```
## API 文档

@@ -24,0 +102,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc