Hello guys this is my second React app that I completed.... I think I should really focus on Async Js and focus more on refactoring and file structuring. One of the challenges I faced was that when I was using react-router....I wanted to use the <Outlet/> to maintain the header component but It wasn't working I got tired and I manually imported and rendered the header component in the /:countryID page and my theme and toggle all got broken ππ because I cant send props. it wasn't a component that could receive props it was just a react-router element={} page which am not rendering anywhere u understand? so I copied the header and pasted it in the /:countryID page π but It worked..how would you have fixed it ??.....Guys what do you think about this project. Kindly share your opinions please.
Giorgi Tarkhnishvili
@GTG4KAll comments
- @Kamasah-DicksonSubmitted almost 2 years ago@GTG4KPosted almost 2 years ago
I've noticed you don't reroute the user to the border countries on click, I've spent too much time trying to figure it out, so just in case you don't know, there is an endpoint in the REST Countries API called Code. https://restcountries.com/v3.1/alpha/{code}
you can just pass the data from border-countries object to this endpoint and it will return the data just like it would when fetching the data with country names.
Marked as helpful0 - @GTG4KSubmitted almost 2 years ago
Having a hard time applying V-model to a custom input component, the way I do it, with a modelValue and update:modelValue, data is sent from child to parent, but not the other way around.
feedback about making v-model work with custom components is greatly appreciated :)
@GTG4KPosted almost 2 years agofor anyone interested, I Solved the v-model issue by passing "modelValue" to the local data inside the component.
for example the checkbox component data would look like this:
{checked: this.modelValue}
this way the model value is sent from the parent component.
<checkbox v-model="checkboxValue"> {checkboxValue: false}
0