axetroy / axetroy/react-download

invalid propType when passing UTF8 bytes array to content prop

Open
#12 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
36
Forks
8
PR merge metrics
No merged PRs in 30d

Description

This is just a warning : `Warning: Failed prop type: Invalid prop `content` of type `object` supplied to `Download`, expected `string`. in Download`, the file is downloaded correctly.

It happens when content property is set to a UTF8 bytes array.

If I convert the byte array to a string, there is no warning but the file data is then incorrect (I am trying to download a PDF file).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the Download component and inspect how its content prop is validated and consumed. Reproduce the warning with a UTF8 byte array and a PDF, then verify that the warning is gone while the downloaded PDF data remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.