Skip to content

Instantly share code, notes, and snippets.

braco

Block or report user

Report or block braco

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@braco
braco / ParseHTML.js
Created Dec 13, 2018
Gatsby + Wordpress reparser
View ParseHTML.js
import React from 'react';
import ReactHtmlParser, { processNodes } from 'react-html-parser';
import generatePropsFromAttributes from 'react-html-parser/lib/utils/generatePropsFromAttributes';
import ModuleName from 'mymodules/ModuleName';
// This module lowercases tags, why?
const overrideComponents = {
modulename: ModuleName,
}
@braco
braco / gutenberg-module.js
Last active Dec 8, 2018
Repeating components in Wordpress Gutenberg
View gutenberg-module.js
```
edit: repeater({
editing: true,
renderComponent: ({ attributes: { name }, setAttributes }) =>
<MyComponent
name={
<PlainText
value={ name }
placeholder={'Name'}
onChange={ value => setAttributes( { name: value } ) }
View epicHelpers.js
import 'rxjs';
import { Observable } from 'rxjs';
Observable.prototype.debug = function(_message) {
const message = `EpicDebug: ${_message}`;
return this.do(
function(next) {
if (__DEV__) {
You can’t perform that action at this time.