Add Typing for Slots

Open
#239 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
react, typescript
Domain
frontend

Research direction

Locate the MDEditor component's slot prop and its TypeScript definitions, then inspect how the textarea slot is currently handled. Done means the available slot components are typed clearly enough to support the shown usage and users can determine which components are valid.

Written by the indexing model from the issue text.

Description

I want to add a labelId to the component - which is not a direct prop. Therefore, I assume it should be passed via slots, but since there is no typing or documentation specifying the available components for the slot, I'm unsure which components can be used. Here's the code I'm working with:

const { value, labelId, ...fieldProps } = field;

return (
  <MDEditor
    {...fieldProps}
    data-color-mode={palette.mode}
    preview="edit"
    style={{ marginTop: 48 }}
    value={value ?? ""}
    slot={{ textarea: { style: { backgroundColor: "teal" } } }}
  />
Dominant language
TypeScript
Stars
382
Forks
37
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uiwjs/react-markdown-editor

All issues in uiwjs/react-markdown-editor

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.