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

New example project #1899

Open
jfontsaballs opened this issue Feb 4, 2023 · 3 comments
Open

New example project #1899

jfontsaballs opened this issue Feb 4, 2023 · 3 comments

Comments

@jfontsaballs
Copy link

jfontsaballs commented Feb 4, 2023

In my journey to learn KotlinJS I've created a small pet project with some examples, using the most up to date version of the wrappers available today (February 4th, 2023). I believe this is important as some example projects out there still use the legacy React wrappers, or they are too small or too big, or they use very outdated versions of the wrappers which is problematic as some apis have suffered some changes recently. Also I tried to write a lot of comments trying to explain the intention and reason for doing things the way I do and to warn about some pitfalls.

I'd like to share this project in case it might be useful to anyone.

https://github.com/jfontsaballs/KotlinJsReactPatterns

@turansky
Copy link
Collaborator

turansky commented Feb 4, 2023

Fast review comments:

  • Kotlin Style Guide is preffered
    • No tabs please :(
  • State in props - antipattern
    • StateIntanse was detected
  • For complex properties (like margin/padding) we have factory functions:
    • Margin
    • Padding
    • and more

@jfontsaballs
Copy link
Author

First of all, thank you very much for reviewing my code.

As per @turansky indications, I changed tabs into spaces and added Margin function.

Also changed the usage of StateInstance class to a newly created interface which removes the coupling such usage created. I assume that this was the reason why it was considered it an antipattern, is it correct?

@santansarah
Copy link
Contributor

Thanks for putting this together - very helpful 😀

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

No branches or pull requests

3 participants