Constructor
# new CustomUpload(props) → {React.ReactElement}
Overview
The component consists ofinput
and label
tags
that are connected by id
and htmlFor
attributes.
Input's display
is set to none
so that only label is visible.
Goal
The goal of this component is to enable any passed children to serve as an upload button.Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
props |
Object | Any other props will be forwarded to the input element. |
||
children |
React.ReactNode |
<optional> |
The content of the component. |
|
accept |
string |
<optional> |
* | Specifies what file types the user can pick from the file input dialog box |
id |
string | The id attributes of an input element and htmlFor attributes of an label element. |
||
onChange |
function |
<optional> |
Callback fired when a file was chosen. |
React.ReactElement