rolajs / rola

An incrementally adoptable framework for building production React sites.
11 stars 0 forks source link

plugin docs #20

Open estrattonbailey opened 5 years ago

estrattonbailey commented 5 years ago

createDocument

createDocument ({ context, ...customProps }) {
  return {
    head: [ '<link />' ],
    body: [ '<script />' ]
  }
}

createServerRoot

createServerRoot ({ root: Root, context }) {
  return props => <div><Root {...props} /></div>
}

createClientRoot

createClientRoot ({ root: Root, context }) {
  return props => <div><Root {...props} /></div>
}

preServerRender

preServerRender ({ context }) {
  return {
    customProp: true
  }
}

postServerRender

postServerRender ({ context }) {
  return {
    customProp: true
  }
}