Skip to content

Conversation

@alexander-zolotykh
Copy link

It allows to render block inside wrapper without leaving styles (#33).

It allows to render block inside wrapper
};

type BlockRenderer = (block: ContentBlock) => ?string;
type BlockRenderer = (block: ContentBlock, generator: MarkupGenerator) => ?string;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second parameter should be optional.

Suggested change
type BlockRenderer = (block: ContentBlock, generator: MarkupGenerator) => ?string;
type BlockRenderer = (block: ContentBlock, generator?: MarkupGenerator) => ?string;

type BlockStyleFn = (block: draftjs.ContentBlock) => RenderConfig|undefined;
type EntityStyleFn = (entity: draftjs.EntityInstance) => RenderConfig|undefined;
type BlockRenderer = (block: draftjs.ContentBlock) => string;
type BlockRenderer = (block: draftjs.ContentBlock, generator: MarkupGenerator) => string;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Owner

@sstur sstur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting closer.

};

type BlockRenderer = (block: ContentBlock) => ?string;
type BlockRenderer = (block: ContentBlock, generator?: MarkupGenerator) => ?string;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you will also need to define a type for MarkupGenerator in this file (not to be confused with the typescript definitions which are totally different).

@botanicus
Copy link

Hey @alexander-zolotykh I wonder whether you'd be finishing the PR? // cc @sstur

I have the same issue and I'm trying to see my options for making it work.

Thanks for the reply :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants