Тёмный

Drag n' Drop Files in React - Parsing CSVs 

Leigh Halliday
Подписаться 33 тыс.
Просмотров 21 тыс.
50% 1

Опубликовано:

 

10 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 107   
@melpacheco9288
@melpacheco9288 4 года назад
don't know how you do it, but you always pick the most relevant topics.
@user-ub7xo3qz2b
@user-ub7xo3qz2b 4 года назад
I love how you explain things - it makes everything crystal clear and understandable. You are a natural teacher, Leigh.
@CoryTheSimmons
@CoryTheSimmons 4 года назад
Yeah, but he doesn't sort files by type in Finder so you really can't trust him.
@leighhalliday
@leighhalliday 4 года назад
Thanks, James!! Glad it was able to help. Lol... Cory's comment.
@sivanesh-s
@sivanesh-s 2 года назад
Thanks a lot for this tutorial. It is simple and I learned two things (How to drag files to upload them and parsing CSV on browser both in 16 minutes video. ✨
@rongschannel
@rongschannel 4 года назад
damn really the first video after 2 hrs that was simple, concise, and made sense
@leighhalliday
@leighhalliday 4 года назад
Nice!! Glad the video could help :) Thanks, Rong!
@TomaNeagu
@TomaNeagu 2 года назад
I think this is the first time when I subbed on to a YT channel and pressed the notification bell with great interest! I also watched your react js recharts video, I learned a lot from you! Thank you! Wish you the best and happy holidays!!
@redux5153
@redux5153 3 года назад
Not all heroes wear capes! thank you!
@CoryTheSimmons
@CoryTheSimmons 4 года назад
Another interesting and actually useful tutorial, Leigh. Can't wait for you to explode in popularity!
@leighhalliday
@leighhalliday 4 года назад
Cheers! Thank you for your support, Cory! Me neither, want one of those sick plaques like Wes Bos was showing off this week haha. Only 93k more followers to go lol.
@18bschade
@18bschade 2 года назад
My Man! You literally just helped me out SO much. Can't thank you enough 🙏
@leighhalliday
@leighhalliday 2 года назад
Nice! Glad it helped :)
@MegaaaFox
@MegaaaFox 3 года назад
didn't know mark wahlberg changed to programming tutorials.. but he does a damn good job ;) thanks for the tutorial
@leighhalliday
@leighhalliday 3 года назад
Haha... I don't think I've ever been compared to Mark Wahlberg before... but I'll take it :D
@youssefmuhamad3213
@youssefmuhamad3213 4 года назад
I'm loving these tutorials, keep it up
@leighhalliday
@leighhalliday 4 года назад
Thanks, Youssef!! Glad you enjoy them :)
@mv696
@mv696 4 года назад
Leigh you've been killin' it lately 💯
@leighhalliday
@leighhalliday 4 года назад
Thanks m, really appreciate it :)
@anuragbhagsain9724
@anuragbhagsain9724 4 года назад
Man you're different from others RU-vidrs 😊 You pick topics that others don't but they should. Really helpful channel. Keep it up and have a good day
@leighhalliday
@leighhalliday 4 года назад
Thanks Anurag! I appreciate the support :) I just do videos that interest me! If it's not interesting to me it's really hard to get motivated to learn about it, create a demo app, record a video, etc... so I don't even try!
@anuragbhagsain9724
@anuragbhagsain9724 4 года назад
@@leighhalliday It's the reason that sets you apart from others. Because you're not making videos just for the sake of making it but to bring actual value to your viewers. Much respect 👏🤗
@felipebeleno7441
@felipebeleno7441 3 года назад
You are the best, greetings from Bogota - Colombia.
@leighhalliday
@leighhalliday 3 года назад
Saludos de Toronto - Canada, nice to have you here! I'm going to Medellín in under 2 weeks, I can't wait!
@javierserna6631
@javierserna6631 3 года назад
Leigh you are awesome, greetings from Spain
@melpacheco9288
@melpacheco9288 4 года назад
Literally trying to do this right now!! thank you
@leighhalliday
@leighhalliday 4 года назад
Nice! For CSV parsing? Images? I was thinking of displaying an image preview... might do that when I move on to tying this in to a form rather than standalone like in this video.
@melpacheco9288
@melpacheco9288 4 года назад
@@leighhalliday uploading image to Cloudinary, and yea, doing the preview part main source of stress.
@abessesmahi4888
@abessesmahi4888 4 года назад
Awesome !!! Thank you so much sir.
@leighhalliday
@leighhalliday 4 года назад
Thanks for your support Abesse!
@marilynnegreteaguilar7102
@marilynnegreteaguilar7102 3 года назад
wow best explanation ever!!
@ahmedpatel408
@ahmedpatel408 3 года назад
Leigh, you are a legend mate, stay happy and stay blessed, and please keep making these amazing tutorials, thank you
@leighhalliday
@leighhalliday 3 года назад
Thanks Ahmed! Glad you're enjoying them :D If you're looking for something more in depth, I just launched a full course!! courses.leighhalliday.com/next-level-next-js
@elad3958
@elad3958 3 года назад
This is EXACTLY what I was looking for!
@leighhalliday
@leighhalliday 3 года назад
Nice!! What are you building?
@cineverseproductions
@cineverseproductions 3 года назад
simple and straightforward, great. 👍
@NathanBudd
@NathanBudd 4 года назад
Watched a few of your videos now, and they're high quality content explained very well.
@leighhalliday
@leighhalliday 4 года назад
Thank you so much Nathan!
@emersonaraujo406
@emersonaraujo406 4 года назад
Great again! You are always bringing us with top content. Thanks for your job.
@leighhalliday
@leighhalliday 4 года назад
Cheers Emerson, thanks for your support :)
@Array_of_objects
@Array_of_objects 2 года назад
This is most likely what flatFile is using behind the scenes. Good video! who wants to pay $1 per upload with flatFile when you can just build yourself lol this is great!
@leighhalliday
@leighhalliday 2 года назад
I don't know flatFile but $1 per upload sounds like a lot!
@pete_shand
@pete_shand 3 года назад
Thanks Leigh this is exactly what I was looking for!!
@leighhalliday
@leighhalliday 3 года назад
Awesome!! Glad I could help :)
@Y_hass
@Y_hass 3 года назад
This is good stuff people! I just had to do a coding challenge exactly like this for a job interview (junior front end).
@leighhalliday
@leighhalliday 3 года назад
Niiiice!! Best of luck getting the job :)
@DannyLeeBeasley
@DannyLeeBeasley 2 года назад
Very helpful, thanks so much man!
@leighhalliday
@leighhalliday 2 года назад
You’re very welcome!
@HolmesPatrick
@HolmesPatrick 3 года назад
Great content - may do a video on dropping a video on drop zone and showing thumbnail for the video - all in front end
@mrkhoros
@mrkhoros 4 года назад
Awesome stuff. You are my favorite coder on RU-vid and I wish to be someone like you in future.
@leighhalliday
@leighhalliday 4 года назад
Hehe, is it my stunning good looks?
@mrkhoros
@mrkhoros 4 года назад
@@leighhalliday Sure why not. You are awesome.
@TheDarco78
@TheDarco78 2 года назад
fantastic!
@user-iu6yz6ck6h
@user-iu6yz6ck6h 4 года назад
super)))
@leighhalliday
@leighhalliday 4 года назад
Thank you very much :)
@SoftDevTJ
@SoftDevTJ 4 года назад
Thanks man! I have searched this topic.
@leighhalliday
@leighhalliday 4 года назад
You're welcome! Glad it could help :)
@RuudvanZuidam
@RuudvanZuidam 4 года назад
Awesome, learned a lot thanks Leigh
@leighhalliday
@leighhalliday 4 года назад
Sweet!! Thanks Ruud :) Happy the video was able to help!
@dominikseljan3043
@dominikseljan3043 4 года назад
Awesome video Leigh! I've never looked into how to make drop zones for uploading files. It's seems really easy with couple of events. Keep up with interesting topics and videos :)
@leighhalliday
@leighhalliday 4 года назад
Hey Dominik! Yea, not so bad eh?? I'll do my best!
@crucialmarsupial3413
@crucialmarsupial3413 4 года назад
Great video Leigh 👍
@leighhalliday
@leighhalliday 4 года назад
Hey Brandon!!! Thank you :) The only thing it's missing are some of my sweet dance moves...
@crucialmarsupial3413
@crucialmarsupial3413 4 года назад
Leigh Halliday hahah you are right. Some wild flailing could really make this lesson stick.
@dankoubz
@dankoubz 3 года назад
Amazing tutorial - thanks!
@leighhalliday
@leighhalliday 3 года назад
Thank you Koubzy! Glad you enjoyed it!
@malikalimoekhamedov2468
@malikalimoekhamedov2468 4 года назад
Great content as always, Leight!
@leighhalliday
@leighhalliday 4 года назад
Thanks for your support, Malik!
@Big-Timbo
@Big-Timbo 2 года назад
great tutorial thanks!
@leighhalliday
@leighhalliday 2 года назад
Thanks Tim!
@gaptekdev
@gaptekdev 4 года назад
really helpful and awesome 👍, thanks for this amazing stuff
@leighhalliday
@leighhalliday 4 года назад
Thanks Eka, glad you enjoyed the video!
@carefree_ladka
@carefree_ladka 3 года назад
Awesome :)
@ridl27
@ridl27 4 года назад
Nice tutorial, man! Thank you. I find your channel really helpful =)
@leighhalliday
@leighhalliday 4 года назад
Thanks Alex, glad the content is helping :)
@user-zq1wn7th8m
@user-zq1wn7th8m Год назад
Thank`s, it help me!!))
@HooKt4
@HooKt4 4 года назад
Haha here I was pausing the video and searching frantically for the .select method that I somhow had missed.
@leighhalliday
@leighhalliday 4 года назад
Haha... I always by accident use the `filter` function in Ruby... keep getting things mixed up.
@бойко-иванов
@бойко-иванов 3 года назад
Hahaha, me too :) Maybe sometimes patience is the answer...
@RailGunViolin
@RailGunViolin 2 года назад
Great video, really enjoyed it. I'm pretty sure you're not supposed to the async inside of a forEach loop . I think for of would be the correct loop to use here. Nevertheless, great video thanks a lot !
@jyorjipatel
@jyorjipatel 3 года назад
I was wondering how to filter out the same files that are dropped in and just not store those in redux store
@eliramalachi
@eliramalachi 2 года назад
Hi Leigh, great video! In the console (chrome) I'm getting "type: application/vnd.ms-excel", is there a way to change it to "text/csv"?
@leighhalliday
@leighhalliday 2 года назад
Hey! Sounds like you’re trying to add an excel file instead of a csv file. They have different mime types… maybe there is a package to parse excel??
@reliable_tech_innovations
@reliable_tech_innovations 3 года назад
Trying to figure out why this works for me in linux (elementary os) but when i run the application in windows this doesn't work, any ideas?
@leighhalliday
@leighhalliday 3 года назад
Sorry Rafael... I have no clue!
@shivamsahil3660
@shivamsahil3660 3 года назад
Wow, this is so helpful! Thanks so much... Do you know how can we proceed with xlsx files?
@reliable_tech_innovations
@reliable_tech_innovations 3 года назад
What would be the most efficient way to then send the data that is in the array to an api? Use a form and then a post request?
@leighhalliday
@leighhalliday 3 года назад
Hey Rafael! If you have the data already, I don't think the form step is necessary. You can send up a POST request to the server with that data.
@pranavmadhani9740
@pranavmadhani9740 3 года назад
github code giving error: fromEntries is not a function
@vaibhavm1986
@vaibhavm1986 4 года назад
Thank you for giving quick start, have one doubt, xls can also be uploaded instead of csv? Also is there any limitations on number of records any idea
@leighhalliday
@leighhalliday 4 года назад
Hey Vaihbhav! The drag and drop portion doesn't really care what type of file it is, but parsing the file is another story. You'd have to use a package like this: www.npmjs.com/package/xlsx I am sure there is some sort of row (file size) limit, but I honestly don't know what it is... a lot probably depends on the person's computer.
@deepakmathur4218
@deepakmathur4218 3 года назад
Unhandled Rejection (TypeError): file.text is not a function. (In 'file.text()', 'file.text' is undefined)
@khaldrogo9451
@khaldrogo9451 4 года назад
How do you get autocomplete when you type file.text()? I can't seem to get any autocomplete features when using a tsx file and typescript.
@leighhalliday
@leighhalliday 4 года назад
Hey Khal! Honestly not sure, I'm just using a pretty standard VS Code setup!
@memoon2055
@memoon2055 4 года назад
Exporting to excel but only selected rows only any ideas....plz help
@leighhalliday
@leighhalliday 4 года назад
Hmmm... do you want actual excel or csv? This tutorial is more about parsing csvs, not so much producing them... I haven't really looked too much into producing and downloading csv files in the browser. There must be a package out there for that?
@albertmk87
@albertmk87 4 года назад
Great stuff. Btw how would you read and store in state the values from two or more csv files at the same time?
@leighhalliday
@leighhalliday 4 года назад
Hey Albert! Thank you :) I think maybe your state could be an array of files rather than just a single one.
@nevermore7755
@nevermore7755 2 года назад
Hello, awesome tutorial! Was just wondering, how would I make a component out of the drop logic? referring to the below code. I tried making a component, but it still needs access somehow to the contacts list, and w.e result it produces, the main app needs to access the result, any help? " { setHighlighted(true); }} onDragLeave={() => { setHighlighted(false); }} onDragOver={(e) => { e.preventDefault(); }} onDrop={(e) => { e.preventDefault(); setHighlighted(false); Array.from(e.dataTransfer.files) .filter((file) => file.type === "text/csv") .forEach(async (file) => { const text = await file.text(); const result = parse(text, { header: true }); setContacts((existing) => [...existing, ...result.data]); }); }} > DROP HERE "
@leighhalliday
@leighhalliday 2 года назад
You’ll need to “life state up” to the parent level so it can be shared across child components via props or context
@siddhartharanganathan556
@siddhartharanganathan556 4 года назад
I'm getting an error "TypeError: file.text is not a function" Could you pls help?
@leighhalliday
@leighhalliday 4 года назад
Sorry, don't know off top of head... I would `console.log(file)` to see what sort of data you're working with.
@adelakunemmanuel5863
@adelakunemmanuel5863 2 года назад
Thank you brother, how can i contact you.......
@MrVisheshsingh
@MrVisheshsingh 4 года назад
🤓😸
@irvingvasquez5017
@irvingvasquez5017 3 года назад
I have a question for you
@leighhalliday
@leighhalliday 3 года назад
What's up?
@irvingvasquez5017
@irvingvasquez5017 3 года назад
@@leighhalliday How could I upload a csv to an API?
Далее
Image Previews in React with FileReader
13:58
Просмотров 27 тыс.
React Data Fetching with Hooks using SWR
18:11
Просмотров 28 тыс.
The Most Elite Chefs Ever!
00:35
Просмотров 8 млн
Instagram Style Route as Modal in Next.js
23:24
Просмотров 23 тыс.
Using reCAPTCHA in React and Node
17:33
Просмотров 44 тыс.
Drag and dropping files in React using react-dropzone
26:26
Creating a User Registration form with react-hook-form
30:48
Google Maps in React - Building interactive maps
25:02
Просмотров 197 тыс.
This React Drag and Drop Component Is Magic
9:56
Просмотров 89 тыс.
Learn React Portal In 12 Minutes By Building A Modal
12:11