Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
So let's now add
this comments section together.
And again, let's make sure that it only shows up
if we are on slash quotes slash some id slash comments.
Now for this, we can render a nested route here,
which means we can import that route component
from React Router DOM, and then below the paragraph,
we can add this route component.
We then give it a path of, for example,
the path here could be slash quotes
slash some id slash comments.
And here we'll have a problem.
Some id, of course, is not always the same id.
It's dynamic.
This quote detail page will be loaded for different ideas.
But we do get the id here,
so we can actually construct a dynamic path here.
And that is something we haven't done up to this point,
but since this is a regular React component
with a regular prop, you can, of course,
also pass in dynamic values, and not just hard-coded paths.
So here we can pass a dynamic value as a path.
And for example, create a template literal,
which is slash quotes slash.
Then we inject params.quoteId,
and then we add slash comments.
So now this route path is constructed dynamically
and it depends on the quote id
for which this quote detail component was loaded.
And that is absolutely something you can build
that you register a route where the path
for which it loads a component is dynamic.
That's not something we did thus far,
but since this is a regular React component,
it is something we can do and we're doing it here.
So now here between the opening and closing route tags,
we can again define which components should be loaded.
And for that I did prepare
this comments component in advance here,
and it's this component which should be loaded now.
So I import comments from going up one level,
diving into components, comments,
and then this comments component here.
And simply add comments here like this.
If I now save this,
if I visit slash quotes slash first quote slash comments,
I do see this comments block here
with this add a comment button
which then opens this super big forum.
The styling is not final yet,
we'll continue working on that.
But we see that it works.
If I just visit slash quotes slash first quote
without slash comments, we don't see that comments block.
So this nested route is working in the way it should.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.