Skip to content

Fix: Rename commands interface for React Native 0.81+ compatibility#5

Merged
mym0404 merged 2 commits intomainfrom
fix/commands-interface-naming
Oct 11, 2025
Merged

Fix: Rename commands interface for React Native 0.81+ compatibility#5
mym0404 merged 2 commits intomainfrom
fix/commands-interface-naming

Conversation

@mym0404
Copy link
Copy Markdown
Owner

@mym0404 mym0404 commented Oct 11, 2025

Summary

Fixes #4

Renames the commands interface from PencilKitCommands to NativeCommands to comply with Fabric codegen naming conventions in React Native 0.81+.

Problem

Users upgrading to React Native 0.81+ encountered "No command found with setTool" errors when calling imperative methods like showToolPicker() and setTool().

Solution

React Native's Fabric codegen requires specific naming patterns for native commands interfaces. Renaming PencilKitCommands to NativeCommands ensures proper code generation and command registration.

Changes

  • Renamed PencilKitCommands interface to NativeCommands
  • Updated Commands export to use the new interface name

Test Plan

  • Build the library successfully
  • Test all imperative methods in example app on iOS 14+:
    • showToolPicker()
    • hideToolPicker()
    • setTool()
    • clear()
    • undo()
    • redo()
  • Verify no "No command found" errors on React Native 0.81+

Fixes #4

React Native 0.81+ requires the commands interface to follow
specific naming conventions for Fabric codegen. Renaming
PencilKitCommands to NativeCommands resolves the "No command
found with setTool" error.
@mym0404 mym0404 merged commit ec54ef6 into main Oct 11, 2025
1 check passed
@mym0404 mym0404 deleted the fix/commands-interface-naming branch October 11, 2025 11:03
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.

No command found with setTool error

1 participant