0
プログラマチックに作成されたブロックの配列からContentStateを作成していますが、ContentStateを使用してEditorStateを作成してもエディタに何も表示されません。カスタムブロックを作成しますか?手動でブロックを作成している場合はDraft.jsカスタムコンテンツブロックが表示されません
const dummyBlocks = [ new ContentBlock({
key: genKey(),
type: 'atomic',
depth: 0,
text: "This is a test block 1",
characterList: List()
}), new ContentBlock({
key: genKey(),
type: 'atomic',
depth: 0,
text: "This is a test block 2",
characterList: List()
})];
const cs = ContentState.createFromBlockArray(dummyBlocks);
const es = EditorState.createWithContent(cs);
自分で 'atomic'ブロックをレンダリングする必要があります。 –
あなたはどうやってそれをしますか? – ryudice