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

Commit

Permalink
Docs tweaks (#1139)
Browse files Browse the repository at this point in the history
* Docs tweaks

- Fix reference to older contentState
- Change `href` to `url` for consistency with "link" example in case people copy-paste between both (which I did today)
- Fix indentation in README

* Update Advanced-Topics-Entities.md
  • Loading branch information
sophiebits authored and mmmoussa committed Apr 19, 2017
1 parent 213cd76 commit 507925a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class MyEditor extends React.Component {
}
render() {
return (
<Editor editorState={this.state.editorState} onChange={this.onChange} />
<Editor editorState={this.state.editorState} onChange={this.onChange} />
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions docs/Advanced-Topics-Entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ const contentState = editorState.getCurrentContent();
const contentStateWithEntity = contentState.createEntity(
'LINK',
'MUTABLE',
{href: 'http://www.zombo.com'}
{url: 'http://www.zombo.com'}
);
const entityKey = contentStateWithEntity.getLastCreatedEntityKey();
const contentStateWithLink = Modifier.applyEntity(
contentState,
contentStateWithEntity,
selectionState,
entityKey
);
Expand All @@ -85,7 +85,7 @@ const blockWithLinkAtBeginning = contentState.getBlockForKey('...');
const linkKey = blockWithLinkAtBeginning.getEntityAt(0);
const contentState = editorState.getCurrentContent();
const linkInstance = contentState.getEntity(linkKey);
const {href} = linkInstance.getData();
const {url} = linkInstance.getData();
```
## "Mutability"

Expand Down

0 comments on commit 507925a

Please sign in to comment.