Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong react file upload code #375

Open
joubeh opened this issue Dec 24, 2024 · 0 comments
Open

Wrong react file upload code #375

joubeh opened this issue Dec 24, 2024 · 0 comments

Comments

@joubeh
Copy link

joubeh commented Dec 24, 2024

The react code in page "https://inertiajs.com/file-uploads" for uploading files using useForm hook has error.
<input type="file" value={data.avatar} onChange={e => setData('avatar', e.target.files[0])} />
The code value={data.avatar} should be removed. it gets error because: InvalidStateError: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.

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

No branches or pull requests

1 participant