Skip to content

0.9.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@octet-stream octet-stream released this 07 May 12:27
· 42 commits to main since this release

Update

  • BREAKING: Move key property from attributes to transform implementation's own properties. This means you have to pass key property to a component manually

    Before v0.9.0

    import {isLink, isText, createElementTransform, createLeafTransform} from "slate-to-react"
    
    export const Link = createElementTransform(
      isLink,
    
      ({attributes, element, children}) => (
        <a {...attributes} href={element.url}>
          {children}
        </a>
      )
    )
    
    export const Text = createLeafTransform(
      isText,
    
      ({children}) => <span>{children}</span>
    )

    Since v0.9.0

    import {isLink, isText, createElementTransform, createLeafTransform} from "slate-to-react"
    
    export const Link = createElementTransform(
      isLink,
    
      ({key, attributes, element, children}) => (
        <a {...attributes} href={element.url} key={key}>
          {children}
        </a>
      )
    )
    
    export const Text = createLeafTransform(
      isText,
    
      ({key, children}) => <span key={key}>{children}</span>
    )

All changes: v0.8.0...v0.9.0