how do I create a list inside a function in react. I mean normaly we use
<ul>
<li>+++</li>
</ul>
but how is this done inside a component in react. ?
how do I create a list inside a function in react. I mean normaly we use
<ul>
<li>+++</li>
</ul>
but how is this done inside a component in react. ?
It’s done in the same way that it’s done in plain HTML, with <ul>
and <li>
tags.
do you mean as a return of the component or as js?
if just a return the it’s done with just html <ul>
or <ol>
and <li>
as @jsdisco pointed
I mean as a component inside a function.
class My_Component extends React.Component {
//do whatever methods or states you want
render() {
return (
<div>
also possible to add any other html here
<ul>
<li>anything you want</li>
</ul>
</div>);
}