Skip to content

Instantly share code, notes, and snippets.

@ravewebdev
Last active July 23, 2020 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ravewebdev/eac5dd8bb7366d268f38ecabfaedaee1 to your computer and use it in GitHub Desktop.
Save ravewebdev/eac5dd8bb7366d268f38ecabfaedaee1 to your computer and use it in GitHub Desktop.
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