Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Commit d40ff40

Browse files
haikyuufacebook-github-bot
authored andcommitted
Update Advanced-Topics-Entities.md (#1767)
Summary: Add a line of code in the example to set the editor state after adding the entity. For a newcomer, it's not straightforward because it wasn't mentioned anywhere in the docs prior to arriving here. Of course, you'll figure it out once you check the example. But let's save newcomers a roundtrip **Summary** Update the docs Pull Request resolved: #1767 Differential Revision: D9749305 fbshipit-source-id: 88af5ee30690fa41cc72280a6bad153a17324c33
1 parent 6df3808 commit d40ff40

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

docs/Advanced-Topics-Entities.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ const contentStateWithLink = Modifier.applyEntity(
6969
selectionState,
7070
entityKey
7171
);
72+
const newEditorState = EditorState.push(editorState, { currentContent: contentStateWithLink });
7273
```
7374

7475
For a given range of text, then, you can extract its associated entity key by using

0 commit comments

Comments
 (0)