Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Using Facade pattern with JSX

507 visualizaciones

Publicado el

Even though the JSX resemble HTML at the first glance it is only the description of the expected UI and is not the UI by itself. What if we can use this fact and play a little with the JSX tags to make the HOC that will allow us to create similar repetitive components in our apps? I will present a small pattern that I found quite useful in one project for creating different users list.

Publicado en: Software
  • Sé el primero en comentar

  • Sé el primero en recomendar esto

Using Facade pattern with JSX

  1. 1. Using Facade pattern with JSX Olena Sovyn (@frontendgirl)
  2. 2. Avatar Name Email Phone EditUser
  3. 3. components.jsx
  4. 4. App.js
  5. 5. user-list.jsx
  6. 6. user-list.jsx
  7. 7. App.js
  8. 8. App.js
  9. 9. Facade pattern Source:
  10. 10. user-list.jsx
  11. 11. extendable textarea react component:
  12. 12. Compound Components … or the
  13. 13. user-list.jsx
  14. 14. 100% correct solution
  15. 15. Why? • Business requirements are different between the projects • Size of the project are different • Our React ecosystem can be different between the projects • We do not know the future
  16. 16. JSX
  17. 17. JS