Skip to content

fix: complete React wrapper and fix docs API references - #23

Draft
poornendushukla with Copilot wants to merge 2 commits into
mainfrom
copilot/complete-react-wrapper-and-doc-check
Draft

fix: complete React wrapper and fix docs API references#23
poornendushukla with Copilot wants to merge 2 commits into
mainfrom
copilot/complete-react-wrapper-and-doc-check

Conversation

Copilot AI commented Apr 5, 2026

Copy link
Copy Markdown

Summary

Completes the React wrapper (react-monkeyjs) and fixes incorrect API references throughout the documentation.


React Wrapper (packages/react-monkeyjs/lib/context/TourProvider.tsx)

Problems fixed

Problem Fix
Auto-started the tour with setTimeout(..., 1000) in useEffect Removed — consumers call useTourContext().start() when ready
tour.start / tour.distroy passed directly to context, losing this binding Wrapped in useCallback so binding is preserved
isTourActive was a static snapshot that never updated Replaced with useState + window.addEventListener('onStart'/'onEnd') for reactive updates
Unused TourController import in type positions Removed; used plain function types instead

Documentation Fixes

Every example in the docs used a non-existent API shape. The actual stepComponent type is:

{
  element: string;          // element ID — no '#' prefix
  title: string;
  description: string;      // not 'content'
  action?: () => Promise<unknown>;   // not onNext/onPrevious/onComplete
  condition?: () => boolean;         // not placement/showArrow
}

Files updated

File What was wrong
StepComponentTable.astro Table rows showed target, content, placement, showArrow, etc.
types.astro StepComponent type had wrong field names
api.astro Listed destroy() — actual method is distroy()
setup.astro Step fields and placeholder tourConfig replaced with real config
configuration.astro stepComponent type and full example used non-existent options
examples.astro All 4 examples (basic, custom theme, React integration, event handling) used wrong fields and non-existent config keys (showOverlay, overlayOpacity, closeOnOutsideClick, etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants