Skip to content

Instantly share code, notes, and snippets.

@YerlinMatu
Created May 17, 2017 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YerlinMatu/bd7c1b146e343b09bcc14af097537b86 to your computer and use it in GitHub Desktop.
Save YerlinMatu/bd7c1b146e343b09bcc14af097537b86 to your computer and use it in GitHub Desktop.
Even or Odd numbers React
<main id="app"></main>
var Operacion = React.createClass({
render:function(){
if(this.props.numero % 2 == 0){
return <h1>¡Wow es un par!</h1>
}else {
return <h1>No es par</h1>
}
}
});
ReactDOM.render(<Operacion numero="9"/>, document.getElementById('app'))
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.min.js"></script>
*{
font-family:arial;
}
@YerlinMatu
Copy link
Author

Componente de números pares o impares.
#React.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment