0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

React ~ 「初手、liine。」は間違いでした。ごめんなさい。

0
Last updated at Posted at 2026-02-08

はじめに

前回の記事 で、次のようなコードを書こうぜ!、すなわち、「初手、const l = useMemo(logic, []) 。」と書きましたが、間違いでしたすみません

export default props => {
  
  const l = useMemo(logic, [])
  useEffect(() => l.cleanup, [])
  
  return (
    <div onClick={l.onclick}>
       描きたいものが近い!
    </div>
  )
}

// 以下省略

研究結果(途中)のご報告

正しくは「初手、const fm = useMyFrontMatter(props)。」です。これ以外の手を打ったら(指したら)負け確定です。つまり前回の記事は負ける手筋を紹介した、三流記事でした。


export default props => {

  const fm = useMyFrontMatter(props) // ⭐⭐これ以外の初手を打ったら(指したら)負け⭐⭐
  
  return (
    <div onClick={fm.onclick}>
       描きたいものが近い!
    </div>
  )
}


//
const useMyFrontMatter = props => {

  const l = useMemo(logic, []) // ⭐⭐この定石を使うかどうかは棋士の自由⭐⭐
  
  useEffect(() => l.cleanup, [])
  return {・・・}
}

// 以下省略

上のソースを見ていただければ明らかなように、const l = useMemo(logic, []) は、二手目以降で使うと勝率が上がりそうなただの手筋のひとつ、誤解をおそれずに言えば「定石」にすぎません。すなわち、二手目以降はどう打とうが(指そうが)棋士の自由なのです。

「初手、const fm = useMyFrontMatter(props)。」以外は負け確定なのですから、初手は何も考えずに打て(指せ)!、考えるのは二手目以降だ!ということになります。

とにもかくにも負け筋を恥ずかしげもなく開陳してしまったこと深く反省しております。誠に申し訳ありませんでした。
現在、ロジックの共有部分を含めて研究を進めています。
そちらのご報告で汚名挽回をしたいと思いますので、しばしお待ちください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?