Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add event handler example to README.md #11

Open
d9k opened this issue Jun 21, 2017 · 3 comments
Open

Add event handler example to README.md #11

d9k opened this issue Jun 21, 2017 · 3 comments

Comments

@d9k
Copy link

d9k commented Jun 21, 2017

Hello! How to define event handlers? The code below doesn't work (webview loads page, but console doesn't log anything).

import ReactWebView from 'react-electron-webview';

// . . . . .
            <ReactWebView
                src={url}
                allowpopups
                plugins
                on-did-finish-load={(e) => {
                    console.log('did-finish-load');
                }}
            />
@d9k
Copy link
Author

d9k commented Jun 22, 2017

@keokilee, up

@d9k
Copy link
Author

d9k commented Jun 22, 2017

@keokilee, ok, I should've define event handler as

                onDidFinishLoad={(e) => {
                    console.log('did-finish-load');
                }}

Thanks for the component development!

@d9k d9k changed the title How to define event handlers?! Add event handler example to README.md Jun 22, 2017
@keokilee
Copy link
Owner

Apologies for the late reply. Yeah, having a README.md to begin with would be nice 😅 In general, the event handlers are implemented as on-<event name> camel-cased, so close would be onClose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants