I figured it out, it wasn't too bad - I am just not that experienced in htmlSerializer just yet but I'm learning fast!
For anyone interested
import React from 'react';
import { Elements } from 'prismic-richtext';
// -- Function to add unique key to props
const propsWithUniqueKey = function(props, key) {
return Object.assign(props || {}, { key });
};
// -- HTML Serializer
// This function will be used to change the way the HTML is loaded
const NoPtag_htmlSerializer = function(type, element, content, children, key) {
var props = {};
switch (type) {
// Add a class to paragraph elements
case Elements.paragraph:
return React.createElement('div', propsWithUniqueKey(props, key), children);
// Return null to stick with the default behavior
default:
return null;
}
};
export default NoPtag_htmlSerializer;