Skip to content

docs: scriptUrl prop is missing from the README props table #36

Description

@sidgaikwad

scriptUrl is a fully supported, fully implemented, fully tested prop — but it does not appear in the README's props table, so there is no way to discover it short of reading the .d.ts.

It exists:

https://github.com/unlayer/react-image-editor/blob/628b507/src/types.ts#L106-L111

It's wired up (loadScript(scriptUrl) and part of the remount effect's deps):

https://github.com/unlayer/react-image-editor/blob/628b507/src/ImageEditor.tsx#L79

It's testedtest/index.test.tsx has "forwards a custom scriptUrl to loadScript" and "remounts when scriptUrl changes".

But the props table lists only image, options, editorId, minHeight, style, onLoad, onSave, onCancel, onLoadError, onError.

Suggested fix

Add the row, and carry over the caveat already written in the doc comment — it is the kind of thing people only discover by breaking it:

One embed per page: the first loader to run installs window.ImageEditor and wins globally, so do not mix different scriptUrls across components.

Related doc gaps (same PR, if wanted)

  • options.offline, options.licenseUrl and options.env are named in the options row but never explained anywhere — that's the whole offline / self-hosted-assets story.
  • Every example is JSX; there's no TypeScript usage example.
  • The exported types ImageEditorRef, ImageEditorOptions and ImageEditorSaveResult are undocumented, though the ref section uses ImageEditorRef implicitly.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions