Last active
July 23, 2020 16:35
-
-
Save ravewebdev/eac5dd8bb7366d268f38ecabfaedaee1 to your computer and use it in GitHub Desktop.
2.1. Frontend React Component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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