Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
2.1. Frontend React Component
const FrontendTracker = ( props ) => {
const {
dataAttributes,
} = props;
const [ attributes, setAttributes ] = useState( {
block_id: 0,
} );
useEffect( () => {
setAttributes( {
...dataAttributes,
} );
}, [] );
return (
<>
<!-- Call components to display our block here... -->
</>
);
};
export default FrontendTracker;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment