Flow throws errors about blockStyleFn
See original GitHub issueFlow is throwing two errors related to blockStyleFn.
~/Desktop/Projects/my-project $ flow
Error: node_modules/draft-js/lib/DraftEditor.react.js.flow:245
245: <DraftEditorContents blockRenderMap={this.props.blockRenderMap} blockRendererFn={this.props.blockRendererFn} blockStyleFn={this.props.blockStyleFn} customStyleMap={{ ...DefaultDraftInlineStyle, ...this.props.customStyleMap }} customStyleFn={this.props.customStyleFn} editorKey={this._editorKey} editorState={this.props.editorState} key={'contents' + this.state.contentsKey} textDirectionality={this.props.textDirectionality} />
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ props of React element `DraftEditorContents`. This type is incompatible with
44: class DraftEditorContents extends React.Component<Props> {
^^^^^ object type. See: node_modules/draft-js/lib/DraftEditorContents.react.js.flow:44
Property `blockRendererFn` is incompatible:
245: <DraftEditorContents blockRenderMap={this.props.blockRenderMap} blockRendererFn={this.props.blockRendererFn} blockStyleFn={this.props.blockStyleFn} customStyleMap={{ ...DefaultDraftInlineStyle, ...this.props.customStyleMap }} customStyleFn={this.props.customStyleFn} editorKey={this._editorKey} editorState={this.props.editorState} key={'contents' + this.state.contentsKey} textDirectionality={this.props.textDirectionality} />
^^^^^^^^^^^^^^^^^^^^^^^^^^ undefined. This type is incompatible with
29: blockRendererFn: Function;
^^^^^^^^ function type. See: node_modules/draft-js/lib/DraftEditorContents.react.js.flow:29
Error: node_modules/draft-js/lib/DraftEditor.react.js.flow:245
245: <DraftEditorContents blockRenderMap={this.props.blockRenderMap} blockRendererFn={this.props.blockRendererFn} blockStyleFn={this.props.blockStyleFn} customStyleMap={{ ...DefaultDraftInlineStyle, ...this.props.customStyleMap }} customStyleFn={this.props.customStyleFn} editorKey={this._editorKey} editorState={this.props.editorState} key={'contents' + this.state.contentsKey} textDirectionality={this.props.textDirectionality} />
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ props of React element `DraftEditorContents`. This type is incompatible with
44: class DraftEditorContents extends React.Component<Props> {
^^^^^ object type. See: node_modules/draft-js/lib/DraftEditorContents.react.js.flow:44
Property `blockStyleFn` is incompatible:
245: <DraftEditorContents blockRenderMap={this.props.blockRenderMap} blockRendererFn={this.props.blockRendererFn} blockStyleFn={this.props.blockStyleFn} customStyleMap={{ ...DefaultDraftInlineStyle, ...this.props.customStyleMap }} customStyleFn={this.props.customStyleFn} editorKey={this._editorKey} editorState={this.props.editorState} key={'contents' + this.state.contentsKey} textDirectionality={this.props.textDirectionality} />
^^^^^^^^^^^^^^^^^^^^^^^ undefined. This type is incompatible with
30: blockStyleFn: (block: ContentBlock) => string;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function type. See: node_modules/draft-js/lib/DraftEditorContents.react.js.flow:30
I’m encountering these errors on a fresh project, with draft-js at 0.10.4
and flow-bin at 0.58.0
.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Error Suppressions - JavaScript. Flow
Flow reports many different kinds of errors for many common programming mistakes, but not every JavaScript pattern can be understood by Flow.
Read more >Solved: On Error Block not triggering and catching error
I've been trying to implement "On Block Error" blocks that will catch any errors thrown by the actions they are encapsulating and handle...
Read more >Flow throws an Error when using the Filter ...
When using the 'Look Up Records' Action in a Flow or Subflow, using the Filter with any field as 'ENDSWITHAPPLICATION' causes the Flow...
Read more >Record Triggered flow builder - Salesforce Developers
But using Record Trigger Flow, One Custom Field, Validation Rule we can ... Can you please tell me how to throw error in...
Read more >Salesforce Error: Failed to trigger a flow
Flow error messages: An unhandled fault has occurred in this flow An ... you have set in Salesforce related to the object that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Better fix:
Remove the question marks (optional types) from
node_modules/draft-js/lib/DraftEditorProps.js.flow
line 62, 65.It has been fixed on master but not released apparently.
This is fixed now - no flow errors at the root of the project. Please reopen if I’m missing something here!