3 ms·
That makes sense. And you can do that with Slate! Since the components are all React components you can use the same types of extending patterns you'd use in R
by ianstormtaylor 10y ago
That makes sense. And you can do that with Slate!
Since the components are all React components you can use the same types of extending patterns you'd use in React. In this case you'd probably use a higher-order component (HOC) that handles adding to the `style` property based on the node's data. And then you could wrap all of your other blocks with it...
quote_block: alignment(QuoteBlock),
code_block: alignment(CodeBlock),
...
One of the things I started with was making sure that components are just React components, so that all of the patterns that the React ecosystem brings can be used with Slate.