Skip to content

Commit

Permalink
added option to include input style as prop
Browse files Browse the repository at this point in the history
📖  added inputStyle prop to README
💅  applied stylefixes
built js bundle
  • Loading branch information
drico authored and nzambello committed Oct 19, 2018
1 parent 64c7cff commit 560d6fe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

React component that handles csv file input.
It handles file input and returns its content as a matrix.

You can try it out in a [demo on Codesandbox](https://codesandbox.io/s/5058ln02lx).

## Installation
Expand Down Expand Up @@ -43,6 +43,7 @@ class App extends Component {
onFileLoaded={this.handleForce}
onError={this.handleDarkSideForce}
inputId="ObiWan"
inputStyle={{color: 'red'}}
/>
)
}
Expand All @@ -61,9 +62,10 @@ ReactDOM.render(<App />, document.getElementById('root'))
| onError | function | | Error handling function. |
| parserOptions | object | `{}` | [PapaParse configuration](https://www.papaparse.com/docs#config) object override |
| inputId | string | | An id to be applied to the `<input>` element. |
| inputStyle | object | `{}` | Some style to be applied to the `<input>` element. |

### Results

When the file has been loaded, it will parsed with [PapaParse](https://github.com/mholt/PapaParse) from a CSV formatted text to a matrix.
When the file has been loaded, it will be parsed with [PapaParse](https://github.com/mholt/PapaParse) from a CSV formatted text to a matrix.
That matrix is returned to the parent component with `onFileLoaded` function (it will be passed as an argument).
The second argument to `onFileLoaded` will be the filename provided
Loading

0 comments on commit 560d6fe

Please sign in to comment.