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

Commit

Permalink
Update Advanced-Topics-Entities.md (#1767)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
haikyuu authored and facebook-github-bot committed Sep 10, 2018
1 parent 6df3808 commit d40ff40
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/Advanced-Topics-Entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const contentStateWithLink = Modifier.applyEntity(
selectionState,
entityKey
);
const newEditorState = EditorState.push(editorState, { currentContent: contentStateWithLink });
```

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

0 comments on commit d40ff40

Please sign in to comment.