Code repitition
o-t-w opened this issue · comments
Currently I'm trying to structure a React Ionic app and am struggling so was looking to this as a reference.
Why is this bit of code repeated for loads of components? Obviously you want it on all those pages, but shouldn't it just be rendered for all routes so you don't have to keep repeating it? <IonHeader> <IonToolbar> <IonButtons slot="start"> <IonMenuButton></IonMenuButton> </IonButtons> <IonTitle>Login</IonTitle> </IonToolbar> </IonHeader>
Yes, you don't need to repeat all code. To get a single for all routes, you can use a HOC and change the content (title and its inner buttons).