js countKeys
let count = Object.keys(myobj).length
what is react
This is a formatted version of Komadori's answer
(https://tinyurl.com/Komadori)
React is a JavaScript library for building user interfaces.
It is maintained by Facebook and a community of
individual developers and companies.
React can be used as a base in the development of single-page
or mobile applications.
react js
//npm
npx create-react-app my-app
//yarn
yarn create react-app my-react-app
react js
class ShoppingList extends React.Component {
render() {
return (
<div className="shopping-list">
<h1>Shopping List for {this.props.name}</h1>
<ul>
<li>Instagram</li>
<li>WhatsApp</li>
<li>Oculus</li>
</ul>
</div>
);
}
}
// Example usage: <ShoppingList name="Mark" />
react js
function Cart() {
const monsteraPrice = 8
const [cart, updateCart] = useState(0)
const [isOpen, setIsOpen] = useState(false)
return isOpen ? (
<div className='lmj-cart'>
<button onClick={() => setIsOpen(false)}>Fermer</button>
<h2>Panier</h2>
<div>
Monstera : {monsteraPrice}€
<button onClick={() => updateCart(cart + 1)}>
Ajouter
</button>
</div>
<h3>Total : {monsteraPrice * cart}€</h3>
</div>
) : (
<button onClick={() => setIsOpen(true)}>Ouvrir le Panier</button>
)
}
react js
// use npm package manager
npx create-react-app my-app --use-npm
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us