Replies: 1 comment 1 reply
-
I always use camelCase for top-level props, as that's the convention generally used for props in client-side components. However, I typically use snake_case for nested properties, as that's typically how they come from the database: return Inertia::render('Profile', [
'currentUser' => [
'first_name' => Auth::user()->first_name,
'last_name' => Auth::user()->last_name,
'email' => Auth::user()->email,
]
]); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I'm just wondering, what is the proper way/naming convention when sharing data via props, is camelCase better than snake_case?
Beta Was this translation helpful? Give feedback.
All reactions