shonen.hateblo.jp

やったこと,しらべたことを書く.

Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor<any>>' but required in type 'ReactPortal'.ts

バージョン

    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-redux": "^8.1.2",
    "@types/react": "^18.2.21",
    "@types/react-dom": "^18.2.7",

現象

React と React Redux を使用しているとき、

import { connect } from 'react-redux';

connect を使用すると、以下のようなコンパイルエラーが発生することがある。 型の整合が合っていないだけで、問題なく動作する。

class HistoryContainer extends React.Component<CombinedProps, State> {
...
}

export default connect<StateProps, DispatchProps, Props, ReduxStoreState>(
  mapStateToProps,
  mapDispatchToProps
)(HistoryContainer);
Argument of type 'typeof HistoryContainer' is not assignable to parameter of type 'ComponentType<never>'.
  Type 'typeof HistoryContainer' is not assignable to type 'ComponentClass<never, any>'.
    Types of property 'contextType' are incompatible.
      Type 'React.Context<any> | undefined' is not assignable to type 'import("/home/fai/repo/chatgpt-note/node_modules/react-redux/node_modules/@types/react/index").Context<any> | undefined'.
        Type 'React.Context<any>' is not assignable to type 'import("/home/fai/repo/chatgpt-note/node_modules/react-redux/node_modules/@types/react/index").Context<any>'.
          The types returned by 'Provider(...)' are incompatible between these types.
            Type 'React.ReactNode' is not assignable to type 'import("/home/fai/repo/chatgpt-note/node_modules/react-redux/node_modules/@types/react/index").ReactNode'.
              Type 'ReactElement<any, string | JSXElementConstructor<any>>' is not assignable to type 'ReactNode'.
                Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor<any>>' but required in type 'ReactPortal'.ts(2345)
続きを読む

How to resolve "Error code 2323" (How to disable ipV6)

LOGIN FAILURE CheckGameVersionException: Error code 2323: Checking Game Version Failed -Error retrieving current game version
Reason: Unable to connect to server

outputLog.txt:

[7:36:53 PM][00:00:46.8775] [07:36:52.322] #=zbYN4WoxtUdPmrVUTGbtJf7_Tt6fA New client state: ConnectingToGameserver
[7:36:53 PM][00:00:46.8775] [07:36:52.322] WebServicesServer connecting to slave server at localhost:4533
[7:36:58 PM][00:00:51.8790] [07:36:54.373] -!!!!!!-> WebServicesServer: Connect() to 'localhost' failed: System.Net.Sockets.SocketException: 対象のコンピューターによって拒否されたため、接続できませんでした。

How to resolve

Disable IPv6 of Ethernet. → How to disable IPv6?

Windows

Please confirm that TCP/IPv6 is not checked. IPv6を無効化する。下の画像のように、チェックが入っていなければ、ipv6は有効になっていない。

Ubuntu

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1

Comment

久々にログインしようとしたら全くログイン出来ず、サポートに問い合わせても返信が全く無いので調べた。
アプリケーションのバグで、アプリケーションがIPv6形式のアドレスを認識出来ていない。IPv6は本来無効化するべきではない。
Freejam が対応するべきバグだが、サポートする気なさそう。謎の自称バランス調整は続けているようですが

複数の図形を独立して動かす

しょうもない所で詰まったので記事化しておく

概要

OpenGLで単純に平面を作ったり、物体を回転させたりする方法などは、こちら

developer.mozilla.org

しかし、複数の物体を動かす方法は記載されていない。まさか各平面の頂点をfor文で加減算する訳にはいかない

続きを読む

gstreamer 触りだけ

note: 本記事は 2019/10/06 に執筆されたまま下書きに眠っていました

gstreamerとは

GStreamer: a flexible, fast and multiplatform multimedia framework

gstreamer.freedesktop.org

パイプのようなストリームベースで動作を記述するCUIのツールが面白くて触ってみました。

確認環境

Ubuntu 19.04

インストール方法

ここに書いてあります

gstreamer.freedesktop.org

apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio

RaspberryPi では一部のパッケージが入っていませんでした。gstreamer1.0-qt5等。

続きを読む