react icon indicating copy to clipboard operation
react copied to clipboard

Bug:

Open irtaza9 opened this issue 3 years ago • 2 comments

React Version: ^18.2.0

Doing

I am setting a parent component state inside useCallback when onChange of an input element take place.

Warring

image

Need Help

I need help regarding this issue as I am not familiar with it.

irtaza9 avatar Oct 21 '22 19:10 irtaza9

Cold you, please, provide more code (or playground) from this use-case?

Maverick17user avatar Oct 22 '22 07:10 Maverick17user

Code

          <div className="w-full mt-3">
            <div className="form-group">
              <input
                type="text"
                className="form-control"
                readOnly={true}
                ref={props?.posttype}
                id="posttype"
                **value={props?.finalfile?.type}**
              />
            </div>
          </div>

I was setting the value in input element when user choose the file and the props.finalfile is the state created in parent component. yesterday I was using the onChange on this element that's why I was getting that warring, then I remove the onChange and used ref to getting the element value and apply readOnly rule to input element and I solved this.

This input element is just to show the value of select file that user will select and i grab that value using ref not by onChange as onChange on triggers when an event occurs to that element.

Btw, Thank you for putting your time to my request.

irtaza9 avatar Oct 22 '22 16:10 irtaza9

It doesn't look like this bug report has enough info for one of us to reproduce it.

Please provide a CodeSandbox (https://react.new), or a link to a repository on GitHub.

Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

eps1lon avatar Oct 29 '22 08:10 eps1lon

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

github-actions[bot] avatar Apr 09 '24 23:04 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

github-actions[bot] avatar Apr 17 '24 10:04 github-actions[bot]