-
-
Save matheusps/36b515928e9ff2069814ce2e4cd988b4 to your computer and use it in GitHub Desktop.
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
| // Integration APP - IO | |
| import { useIframeState, Iframe } from '@vtex/raccoon-io' | |
| const [size, setSize] = useState('250px') | |
| const iframe = useIframeState({ | |
| asyncHandlers: { | |
| resize: (data: any) => { | |
| setSize(data.size) | |
| } | |
| } | |
| }) | |
| /* button to reduce the navigation */ | |
| // post message to the iframe | |
| <Iframe style={{ width: size }} state={iframe} /> | |
| // App Next | |
| import { publishMessage } from '@vtex/raccoon-next' | |
| publishMessage({ | |
| type: 'resize', | |
| data: { | |
| size: '500px' | |
| } | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment