Jesse Wei
banner
mrjwei.bsky.social
Jesse Wei
@mrjwei.bsky.social
Product Designer & Software Engineer | Bridging creativity and technology to drive innovations.

My blog and works:
https://www.jessewei.net/
The params prop is part of the dynamic API and was made asynchronous in Next.js 15. Essentially, we just need to follow the instruction—await params before accessing its properties, like this:

const id = (await params).id
February 27, 2025 at 12:02 PM
I didn't know the labelling/naming thing! Thanks for sharing! I can see its potential to significantly improve code readability and maintainability, because in my case positions of values are important!
February 26, 2025 at 12:39 AM
The issue? val2 is typed as string | number, but ChildComp expects a string. Since I knew val1 would always be a number and val2 a string, I redefined the prop with a more specific structure:

props: [number, string];

#TypeSafty #DevTips
February 24, 2025 at 12:34 AM
But when I spreaded it and then passed it to a child component,

const [va1, val2] = prop;
<ChildComp prop={val2}>

I got the error, Type 'string | number' is not assignable to type 'string'.
February 24, 2025 at 12:34 AM
A better approach is to keep secrets on the server and never send them to the client. This is where Next.js Server Components come in handy. #ServerComponents #Security
January 12, 2025 at 1:42 AM
To make env vars accessible in the browser, we can prefix them with NEXT_PUBLIC_, but that completely defeats the purpose of keeping them secret.
January 12, 2025 at 1:42 AM
At first, I didn’t fully get this, thinking I could manage sensitive data using environment variables in client components to keep them hidden. But that doesn’t work, because env vars are only available on the server by default.
January 12, 2025 at 1:42 AM
For a deeper dive into views vs. copies with accessible examples, check out my blog post here ↓

www.jessewei.net/articles/und...
Understanding the SettingWithCopyWarning in Pandas
When working with Pandas, you may encounter the SettingWithCopyWarning. In this article, I'll share my findings to help you understand the warning, its cause and how to prevent it.
www.jessewei.net
January 5, 2025 at 1:08 PM
Chained assignment is discouraged because it creates temporary intermediate objects, which may be views in some cases and copies in others. This unpredictability can lead to unexpected bugs, and that’s exactly what the SettingWithCopyWarning is designed to warn us about.
January 5, 2025 at 1:08 PM
To ensure our code behaves as expected, we need to be explicit:
• If we want to modify the original data, we should operate on it directly.
• If we need to preserve the original, we should explicitly create a copy and modify the copy.
January 5, 2025 at 1:08 PM
The root cause lies in how #NumPy handles data: depending on the indexing operation, it may return either a view or a copy to optimize performance. The problem? We can’t always predict which one we’re getting.
January 5, 2025 at 1:08 PM
Once the data is parsed into a datetime object, pandas automatically standardizes it to its default YYYY-MM-DD format. To display the date in a different format, use .dt.strftime().
December 28, 2024 at 12:35 PM