react-component / react-component/select

when custom define Cascader children ,it occur createElement error

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

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
938
Forks
482
Avg merge
15h 8m
Merged PRs (30d)
2

Description

https://github.com/react-component/select/blob/fe1a13a6ccb9551e17fe7c8ea282bf5df907041d/src/BaseSelect.tsx#L348
In code, it use customizeRawInputElement.props.ref, but in line 794, it assignments to self by cloneElement.
when i used, children is a ReactNode, it warn i should use forwardRef.when i use it, it occured createElement error.

   {customizeRawInputElement ? (
        React.cloneElement(customizeRawInputElement, {
          ref: customizeRawInputRef,
        })
      ) :<Selector>

why it write this

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.

Research direction

Start at src/BaseSelect.tsx lines 348 and 794, then reproduce the custom children case described in the issue with the React ref warning and createElement error. Compare the ref access with the React.cloneElement call; done means the failure is explained and the custom raw input path has verified compatible behavior or a documented limitation.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.