Creating custom nested component - adding children

オープン
#566 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
react, typescript
領域
frontend

調査の方向性

まず src/components/ReactComponent.jsx を読み、issue で説明されているカスタムの NestedReactComponent と attachReact のエントリーポイントをたどります。this.components がどのように扱われているかを確認します。作成したカスタムコンポーネントが attachReact を通じてネストされた子要素をレンダリングできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Hi,

I would like to create custom nested component. But not sure how to proceed in this case.

I wanted to go with writing similar class as https://github.com/formio/react/blob/master/src/components/ReactComponent.jsx that wound extend Formio.Components.components.nested.

Something like

import { Formio } from '@formio/js';

const Nested = Formio.Components.components.nested;

export abstract class NestedReactComponent extends Nested {
  ...
    abstract attachReact(element:, ref); 
}

And I would implement all the methods needed as in ReactComponent.

Then I would like to extend this base class for every custom nested component needed. And this is sort of working.
I cannot actually add the (nested) children to the created custom component. I can see that i have this.components in the base class, but I don't how to add them as children to the element overridden attachReact method.

主要言語
TypeScript
スター
371
フォーク
309
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

formio/react のほかの issue

formio/react の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。