-
Notifications
You must be signed in to change notification settings - Fork 50
Fix React key warnings in Blogs and resolve zoom plugin dependencies #249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -25,7 +25,7 @@ export default function Blogs() { | |||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||
| <div className="right"> | ||||||||||||||||||||||||
| {blogPosts.slice(0, 3).map((item, index) => ( | ||||||||||||||||||||||||
| <div key={index} className="viewBlogContainer"> | ||||||||||||||||||||||||
| <div key={item.metadata.permalink} className="viewBlogContainer">/* Better to use unique identifer than index as key */ | ||||||||||||||||||||||||
| <h3 onClick={() => history.push(item.metadata.permalink)}> | ||||||||||||||||||||||||
| {item.metadata.title} | ||||||||||||||||||||||||
| </h3> | ||||||||||||||||||||||||
|
|
@@ -35,7 +35,7 @@ export default function Blogs() { | |||||||||||||||||||||||
| <div className="info"> | ||||||||||||||||||||||||
| <div className="author"> | ||||||||||||||||||||||||
| {(item.metadata?.authors || []).map((item) => ( | ||||||||||||||||||||||||
| <a href={item.url} target="_blank"> | ||||||||||||||||||||||||
| <a key={item.name} href={item.url} target="_blank" rel="noreferrer"> | ||||||||||||||||||||||||
| {item.name} | ||||||||||||||||||||||||
| </a> | ||||||||||||||||||||||||
| ))} | ||||||||||||||||||||||||
|
Comment on lines
37
to
41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are a couple of improvements that can be made here for clarity and robustness:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Payel-Manna please modify your code to given suggested code by ai. |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An invalid C-style comment (
/* ... */) has been added within the JSX. This will cause a syntax error and break the React application. Comments inside JSX should be enclosed in curly braces and asterisks like{/* this is a comment */}. Since this comment just explains a standard React practice, it's better to remove it entirely for cleaner code.