Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

KenjiMorita kenmori

🏠
Working from home
View GitHub Profile
@kenmori
kenmori / Rendered fewer hooks than expected. This may be caused by an accidental early return statement.md
Last active Jul 15, 2020
Rendered fewer hooks than expected. This may be caused by an accidental early return statement.
View Rendered fewer hooks than expected. This may be caused by an accidental early return statement.md

Rendered fewer hooks than expected. This may be caused by an accidental early return statement.

これがでたあなた。 恐らく 原因はmapで回すrender関数とHooksの相性が悪いことのような気がしています

https://github.com/facebook/react/issues/14250#issuecomment-439651551

JSX内で関数を使うと、その中ではHooksは使えません。

@kenmori
kenmori / 【Jest x redux-thunk x TypeScript】test example.md
Last active Feb 29, 2020
これ。【Jest x redux-thunk x GraphQL x TypeScript】test example
View 【Jest x redux-thunk x TypeScript】test example.md

【Jest x redux-thunk x TypeScript】 test example

I was looking for an example. Just a little less,

so leave what you actually wrote.

This is different from the official.

@kenmori
kenmori / JavaScriptを学びたての方に向けた「JavaScriptの課題」.md
Last active Jan 25, 2021
JavaScriptを学びたての方に向けた「JavaScriptの課題」
View JavaScriptを学びたての方に向けた「JavaScriptの課題」.md

JavaScriptを学びたての方に向けた「JavaScriptが使えるようになる課題」

WIP

  • リアルな現場で使うもの

DOM操作

API通信

@kenmori
kenmori / Please make sure you have the correct access rights and the repository exists.md
Last active Jan 30, 2021
【急に....!!解決する方法(画像付き)】 Please make sure you have the correct access rights and the repository exists.
View Please make sure you have the correct access rights and the repository exists.md

【解決方法(画像付き)】急に。git pushしたら「Please make sure you have the correct access rights and the repository exists.」

このように出た時の話です

このように言われた時の話【急に....!!解決する方法(画像付き)】 Please make sure you have the correct access rights and the repository exists.

結論から。sshkeyを作ってgithubに登録し直す。 下記はその具体的な方法です

git push origin head したら

@kenmori
kenmori / Create an object from an array with multiple ids, using the id as a key and knowing how many identical ids each have.md
Last active Feb 10, 2020
Create an object from an array with multiple ids, using the id as a key and knowing how many identical ids each have
View Create an object from an array with multiple ids, using the id as a key and knowing how many identical ids each have.md

Create an object from an array with multiple ids, using the id as a key and knowing how many identical ids each have

function createOrder(organization: TreeOrganization, valueId: number): number {
    return organization.values
        .map(o => o.parentId)
        .reduce((a, c) => {
            return a[`${c}`] === undefined
@kenmori
kenmori / TwitterWithMarkDown.md
Last active Feb 8, 2020
How to write a Twitter link in Markdown
View TwitterWithMarkDown.md

How to write a Twitter link in Markdown

Twitter URL


[![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/bukotsunikki.svg?style=social&label=Follow%20%40bukotsunikki)](https://twitter.com/bukotsunikki)

author

View 【解決】WordPressでもっとみるさらにみるshow moreの設定の仕方トップページを記事一覧にする.md
@kenmori
kenmori / ReduxStyleGuide.md
Last active Jan 19, 2020
Redux StyleGuideまとめ
View ReduxStyleGuide.md

ReduxStyleGuide

Priority A Rules: Essential

Do Not Mutate State

stateを変化させない

Priority B: Strongly Recommended

@kenmori
kenmori / how_to_reduce.md
Last active Jun 7, 2020
【わかりやすい】Array#reduceの使い方。reduceに強くなる記事。how to reduce
View how_to_reduce.md

【鍛えよう】reduceの使い方。reduceに強くなる記事。how to use reduce

reduceって何?

  • reduceとはArrayが持つメソッド

使い方は?

["a", "b"]
@kenmori
kenmori / Handling for union when you do not want to use type guard.md
Last active Jan 4, 2020
Handling for union when you do not want to use type guard
View Handling for union when you do not want to use type guard.md

Handling for union when you do not want to use type guard

You need to type gurd this

type Uni = "A" | "B"

type Fa = {
    contentType : Uni
}