This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font: 14px "Century Gothic", Futura, sans-serif; | |
margin: 20px; | |
} | |
ol, ul { | |
padding-left: 30px; | |
} | |
.board-row:after { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
import ReactDOM from "react-dom"; | |
import './css/react-tutorial.css'; | |
interface BoardProps { | |
squares: ISquare[]; | |
onClick: (i: number) => void; | |
} | |
interface SquareProps { | |
value: ISquare; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var pug = require('gulp-pug'); | |
// gulp.task('タスク名', 実行される処理)でタスク作成 | |
gulp.task('default', () => { | |
gulp.src( | |
['./pug/**/*.pug', '!./pug/**/_*.pug'] | |
) | |
.pipe(pug({ | |
pretty: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doctype | |
html(lang="ja") | |
head | |
meta(charset="utf-8") | |
meta(name="viewport" content="width=device-width,initial-scale=1.0") | |
title Tweet Share | |
link(rel="stylesheet" href="style.css") | |
body | |
header | |
h1 Tweet Share |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useReducer } from "react"; | |
import ReactDOM from "react-dom"; | |
const initData = { | |
num: 0, | |
message: "クリックしてください" | |
} | |
const reducer = ({num} , action) => { | |
// eslint-disable-next-line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useContext, useReducer, createContext } from "react"; | |
import ReactDOM from "react-dom"; | |
const DispatchContext = createContext(() => {}); | |
const reducer = (num , action) => { | |
//eslint-disable-next-line | |
switch (action) { | |
case 'increment': | |
return num + 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useContext, useReducer, createContext } from "react"; | |
import ReactDOM from "react-dom"; | |
const DispatchContext = createContext(() => {}); | |
const reducer = ({ year, month }, action) => { | |
//eslint-disable-next-line | |
switch (action) { | |
case 'increment': | |
return month === 11 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { connect } from 'react-redux'; | |
import './App.css'; | |
const mappingState = state => state ; | |
// Appコンポーネント | |
const App = () => { | |
const style = { | |
color: "blue" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { connect } from 'react-redux'; | |
import './App.css'; | |
// ステートのマッピング | |
function mappingState(state) { | |
return state; | |
} | |
// Appコンポーネント | |
function App() { | |
const style = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let t:string | null = "Hello TypeScript!!"; | |
t = null; | |
console.log(t); | |
// 配列の型推論 | |
let n:number[] = [1,2,3,4]; | |
console.log(n[0]); | |
// オブジェクトの型推論。interfaceの代わりにtypeでもOK | |
interface User { | |
id: number | |
name: string |
NewerOlder