Find MAMP's installed PHP version(s) you want to use the PHP CLI for:
$ ls -l /Applications/MAMP/bin/php/
- First, open your local user's
.bash_profilein edit mode, in order to add aliases for accessing the PHP CLI locally
$ pico ~/.bash_profile
| <!doctype html> | |
| <title>Site Maintenance</title> | |
| <style> | |
| body { text-align: center; padding: 150px; } | |
| h1 { font-size: 50px; } | |
| body { font: 20px Helvetica, sans-serif; color: #333; } | |
| article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
| a { color: #dc8100; text-decoration: none; } | |
| a:hover { color: #333; text-decoration: none; } | |
| </style> |
| import React, { useState } from 'react'; | |
| const Test = () => { | |
| return ( | |
| <h1>This is test component</h1> | |
| ) | |
| } | |
| export default Test |
Find MAMP's installed PHP version(s) you want to use the PHP CLI for:
$ ls -l /Applications/MAMP/bin/php/
.bash_profile in edit mode, in order to add aliases for accessing the PHP CLI locally$ pico ~/.bash_profile
| <html> | |
| <body> | |
| <div id="app"></div> | |
| </body> | |
| <script | |
| src="https://unpkg.com/react@18/umd/react.development.js" | |
| crossorigin | |
| ></script> | |
| <script |
| // reducer | |
| const person = { | |
| name: '', | |
| age: '', | |
| national:'' | |
| } | |
| export const personReducer = (state = person, action) => { | |
| switch (action.type) { | |
| case 'NAME': | |
| return {...state, name: action.payload} |
| /* | |
| * Handling Errors using async/await | |
| * Has to be used inside an async function | |
| */ | |
| try { | |
| const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
| // Success 🎉 | |
| console.log(response); | |
| } catch (error) { | |
| // Error 😨 |
| import { connect } from "react-redux"; | |
| function App(props){ | |
| return ( | |
| <div>App</div> | |
| ); | |
| } | |
| // reducer içindeki state'e erişir, state'in içindeki değerlerden hangisini istersek onu return eder |
| /* | |
| ##Device = Desktops | |
| ##Screen = 1281px to higher resolution desktops | |
| */ | |
| @media (min-width: 1281px) { | |
| /* CSS */ | |
JS öğrenirken genelde null değerine boş değer denilip geçilir herhalde öğrenenin kafası karışmasın diye detaya girmiyor instructorlar fakat bu sefer undefined ile karıştırılabiliyor ve bunun ayrımını yapmak bir karmaşaya dönüşmeye başlıyor.
bu değerlerin typeof'una bakıldığında
typeof null // object
typeof undefined // undefined