How to use default values for props in rbxts/React?
Am I properly specifying default values for props in this case? Is the "={}" in the signature necessary?

10 Replies
are you using .tsx file?
it's usually
isnt that cleaner?
Solution
or
jesus i am. Thank you
wait
.tsx
and import React
and in ts config dont forget

Ok so basing off of what you said
Would the callbacks also be captial according to the style guide
Also do you have any reference code/guide I could look at. I hate to have to ask what would be simple questions
Oh you better not use my style guide 🫠, it's Very specific and very far from standard
Or if you just want to experiment, sure
Style Guidelines
When contributing to this project, please adhere to the following style conventions:
Naming Conventions
Functions
- Use
PascalCase
for all functions (both private and public)
Variables
- Use snake_case
for local variables
- Use PascalCase
for public variables or variables that are getting exported (in classes, namespaces and global space)
- Use bullet_case_
for private variables in classes
Classes
- Use PascalCase
for public and private functions in classes
Interfaces & Enums
- Interfaces are ALWAYS prefixed with I
- Enums are ALWAYS prefixed with E
- Since variables in interfaces are public, always use PascalCase
for them
Constants
- Constants are ALWAYS using CONSTANT_CASE
Code Structure
- Prefer creating nested functions using variables
Examples:
And my class usually looks like this
Thank you 🤗
that's the most insane style guideline I've seen
you could rehabilitate by going full snake_case
Hell nah