From 8b95aa8e8e848210533deb6aeb15d9b2a29eb2de Mon Sep 17 00:00:00 2001 From: Nick Michael Date: Tue, 29 Aug 2017 15:54:12 +0100 Subject: [PATCH] Pass entire file into fileTemplate Lets you use file data in other functions in the template: e.g ``` customFile = (props) => { return ( this.handleDragStart(e, props)}>' + '' + ''}} /> { props.name } ) } ``` So now we pass props (which in this case is now the entire file) into the `onDragStart` handler --- src/FileView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FileView.js b/src/FileView.js index 05fa555..a52118d 100644 --- a/src/FileView.js +++ b/src/FileView.js @@ -21,7 +21,7 @@ const FileView = (props) => { className={cns} onClick={onclickFn}> { - fileTemplate && fileTemplate({ name: file.name }) || + fileTemplate && fileTemplate(file) || |__{file.name} }