react-beautiful-dnd-next
Version:
Beautiful and accessible drag and drop for lists with React
40 lines (30 loc) • 821 B
JavaScript
// @flow
import { warning } from '../../dev-warning';
const suffix: string = `
We expect a html5 doctype:
This is to ensure consistent browser layout and measurement
More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/doctype.md
`;
export default (doc: Document) => {
const doctype: ?DocumentType = doc.doctype;
if (!doctype) {
warning(`
No found.
${suffix}
`);
return;
}
if (doctype.name.toLowerCase() !== 'html') {
warning(`
Unexpected found: (${doctype.name})
${suffix}
`);
}
if (doctype.publicId !== '') {
warning(`
Unexpected publicId found: (${doctype.publicId})
A html5 doctype does not have a publicId
${suffix}
`);
}
};