You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
468 B
23 lines
468 B
import React from "react"; |
|
|
|
class Validation extends React.Component { |
|
constructor(props) { |
|
super(props); |
|
console.log("Validation:", props); |
|
} |
|
|
|
validation() { |
|
let validationMessage = <p>good enough</p>; |
|
if (this.props.length >= 5) { |
|
validationMessage = <p>TOO MUCH, STAHP</p>; |
|
return validationMessage; |
|
} |
|
return validationMessage; |
|
} |
|
|
|
render() { |
|
return <div>{this.validation()}</div>; |
|
} |
|
} |
|
|
|
export default Validation;
|
|
|