Answer the question
In order to leave comments, you need to log in
How to create a css class inside a component and apply it to an element?
How to create a CSS class inside a React component and then apply it to an element.
For example, I create a class .list and apply it className={ list }, but to keep the name without any hashes, as in aphoride.
Answer the question
In order to leave comments, you need to log in
<div className="list" />
const className = 'list';
return <div className={className} />;
Went the other way. Since anyway, there were not many records. Then I just added a new variable - count, which counts the number of records with status 1, and I skip checking if there are already more than 3 records.
if($row->status == '1') {
if($count >= 3)
continue;
$count++;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question