Skip to content
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

Tutorial confusing on PascalCase for function components #3759

Open
1 of 5 tasks
GunnarBernsteinHH opened this issue Oct 31, 2024 · 0 comments
Open
1 of 5 tasks

Tutorial confusing on PascalCase for function components #3759

GunnarBernsteinHH opened this issue Oct 31, 2024 · 0 comments

Comments

@GunnarBernsteinHH
Copy link

GunnarBernsteinHH commented Oct 31, 2024

This is about:

  • A typo
  • Inaccurate/misleading documentation (e.g. technically incorrect advice)
  • Undocumented code
  • Outdated documentation
  • Other

Problem

I startet to read from the beginning, so first page was:
Function Components
Where this statement is made "By convention, the function is named in PascalCase, like all components, to contrast its use to normal html elements inside the html! macro."

Then I went through the excellent starting tutorial, where now:
Tutorial Components
Here, in the text again PascalCase: "Notice the parameters of our VideosList function component."
But the code is written according to Rust standards: videos_list

#[function_component(VideosList)]
fn videos_list(VideosListProps { videos }: &VideosListProps) -> Html {

This makes me wonder if the naming convention has been adapted recently.

Or maybe now it is customary to write the PascalCase name in brackets after to annotation to not mess with Rust Analyzer. I believe a clarification would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant