Update keys_in_react.md
feat: Added v4 to uuidv4 as uuid is not supported in the latest versions of Javascript.
Because when I tried doing uuid, I started getting errors, then after I researched the issue for a bit, I found it was a bit outdated code, the newer ones support 'uuidv4'.
This PR
- changed from 'uuid' to 'uuidv4' and added import
Issue
Closes #XXXXX
Additional Information
Pull Request Requirements
- [x] I have thoroughly read and understand The Odin Project curriculum contributing guide
- [x] The title of this PR follows the
location of change: brief description of changeformat, e.g.Intro to HTML and CSS lesson: Fix link text - [x] The
Becausesection summarizes the reason for this PR - [x] The
This PRsection has a bullet point list describing the changes in this PR - [x] If this PR addresses an open issue, it is linked in the
Issuesection - [x] If any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
- [x] If any lesson files are included in this PR, they follow the Layout Style Guide
Sorry, if this is a minor change, I got stuck here for quite a bit, so I thought of adding it.
I don;t really know how the pull thing works, I think I have to reopen though.
I don;t really know how the pull thing works, I think I have to reopen though.
Yes; you've opened a pull request, and now need to wait for one of the maintainers to review it. If they approve it, they will merge it into the main branch, at which point your changes will be applied to the live version of the curriculum
We could do something clever and reduce it to just:
import { v4 as uuid } from 'uuid';
It will update the code to use the v4 uuids, but keep the rest of the function calls as they currently are.
Actually, if all we're doing is creating UUID's, do we even need the library? I'm fairly the build in crypto library has a function for that
Actually, if all we're doing is creating UUID's, do we even need the library? I'm fairly the build in
cryptolibrary has a function for that
You read that too? :D
I agree though, we could do it that way. Might need some of the other maintainers to check there's no actual reason why we're using uuid specifically first.
You read that too? :D
I plead the Fifth
I agree though, we could do it that way. Might need some of the other maintainers to check there's no actual reason why we're using uuid specifically first.
I am not intimately familiar with this part of the curriculum, but the primary reason I could think of was that we might use it more later on, but a quick GitHub search seems to suggest this is the only occurrence of it
We don't need to import the uuid library for this example; we can use the built-in crypto.randomUUID() function for each of those instead.
@MaoShizhong So there's no technical or lesson-based reason we're using the uuid package then? Sounds like we can drop a package, which is always nice. :)
An auto increment would also work fine.
@asimn7 is this something you still wish to work on?