Skip to content

Instantly share code, notes, and snippets.

View itsam's full-sized avatar

Yiannis Tsampoulatidis itsam

  • Thessaloniki Greece
View GitHub Profile
import React, { useState } from 'react';
const Form = () => {
const [ownerState, setOwnerState] = useState({
owner: '',
description: '',
});
const handleOwnerChange = (e) => setOwnerState({
...ownerState,
@pbojinov
pbojinov / README.md
Last active June 24, 2024 05:39
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe