{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/22259","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/22259/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/22259/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/22259/events","html_url":"https://github.com/facebook/react-native/issues/22259","id":380200825,"node_id":"MDU6SXNzdWUzODAyMDA4MjU=","number":22259,"title":"[iOS] WKWebView reloads page each time it gets back into the foreground","user":{"login":"petlys","id":6960273,"node_id":"MDQ6VXNlcjY5NjAyNzM=","avatar_url":"https://avatars1.githubusercontent.com/u/6960273?v=4","gravatar_id":"","url":"https://api.github.com/users/petlys","html_url":"https://github.com/petlys","followers_url":"https://api.github.com/users/petlys/followers","following_url":"https://api.github.com/users/petlys/following{/other_user}","gists_url":"https://api.github.com/users/petlys/gists{/gist_id}","starred_url":"https://api.github.com/users/petlys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petlys/subscriptions","organizations_url":"https://api.github.com/users/petlys/orgs","repos_url":"https://api.github.com/users/petlys/repos","events_url":"https://api.github.com/users/petlys/events{/privacy}","received_events_url":"https://api.github.com/users/petlys/received_events","type":"User","site_admin":false},"labels":[{"id":1056126664,"node_id":"MDU6TGFiZWwxMDU2MTI2NjY0","url":"https://api.github.com/repos/facebook/react-native/labels/%F0%9F%94%B6Components","name":"🔶Components","color":"fef2c0","default":false},{"id":1113225428,"node_id":"MDU6TGFiZWwxMTEzMjI1NDI4","url":"https://api.github.com/repos/facebook/react-native/labels/%F0%9F%94%B6View","name":"🔶View","color":"fef2c0","default":false},{"id":860843215,"node_id":"MDU6TGFiZWw4NjA4NDMyMTU=","url":"https://api.github.com/repos/facebook/react-native/labels/%F0%9F%94%B6WebView","name":"🔶WebView","color":"fef2c0","default":false},{"id":257497884,"node_id":"MDU6TGFiZWwyNTc0OTc4ODQ=","url":"https://api.github.com/repos/facebook/react-native/labels/%F0%9F%94%B7iOS","name":"🔷iOS","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-13T12:23:29Z","updated_at":"2018-11-14T09:05:15Z","closed_at":null,"author_association":"NONE","body":"<!-- Requirements: please go through this checklist before opening a new issue -->\r\n  - [x] Review the documentation: https://facebook.github.io/react-native\r\n  - [x] Search for existing issues: https://github.com/facebook/react-native/issues\r\n  - [x] Use the latest React Native release: https://github.com/facebook/react-native/releases\r\n\r\n## Environment\r\n\r\n```\r\n  React Native Environment Info:\r\n    System:\r\n      OS: macOS High Sierra 10.13.6\r\n      CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz\r\n      Memory: 2.96 GB / 16.00 GB\r\n      Shell: 5.3 - /bin/zsh\r\n    Binaries:\r\n      Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node\r\n      npm: 6.4.1 - ~/.nvm/versions/node/v8.12.0/bin/npm\r\n      Watchman: 4.9.0 - /usr/local/bin/watchman\r\n    SDKs:\r\n      iOS SDK:\r\n        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1\r\n      Android SDK:\r\n        API Levels: 23, 25, 26, 27\r\n        Build Tools: 23.0.1, 25.0.1, 27.0.3\r\n    IDEs:\r\n      Android Studio: 3.1 AI-173.4907809\r\n      Xcode: 10.1/10B61 - /usr/bin/xcodebuild\r\n    npmPackages:\r\n      react: 16.6.0-alpha.8af6728 => 16.6.0-alpha.8af6728 \r\n      react-native: 0.57.4 => 0.57.4 \r\n    npmGlobalPackages:\r\n      react-native-cli: 2.0.1\r\n```\r\n\r\n## Description\r\n\r\n**iOS only!**\r\n\r\nI have an simple app that simply renders a view with a `<WebView>` with and a `<Modal>`.\r\nAll good until you open and close the `<Modal>`, in which case the `<WebView>` will reload the webpage being displayed. \r\nThe same goes for anything else that might put the `<WebView>` in the background and then in the foreground again. For instance opening a Safari view (https://github.com/naoufal/react-native-safari-view). Each time the `<WebView>` gets back into the foreground again, it reloads the page. \r\n\r\nThis happens **only** with WKWebView (i.e `useWebKit` prop being passed). The old UIWebView works as expected. \r\n\r\n```javascript\r\n<View>\r\n  <Modal visible={this.state.showModal}>\r\n    ...\r\n  <Modal>\r\n\r\n  <WebView useWebKit source={{ uri: 'https://some.web.page.com' }} />\r\n</View>\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/438588626","html_url":"https://github.com/facebook/react-native/issues/22259#issuecomment-438588626","issue_url":"https://api.github.com/repos/facebook/react-native/issues/22259","id":438588626,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODU4ODYyNg==","user":{"login":"petlys","id":6960273,"node_id":"MDQ6VXNlcjY5NjAyNzM=","avatar_url":"https://avatars1.githubusercontent.com/u/6960273?v=4","gravatar_id":"","url":"https://api.github.com/users/petlys","html_url":"https://github.com/petlys","followers_url":"https://api.github.com/users/petlys/followers","following_url":"https://api.github.com/users/petlys/following{/other_user}","gists_url":"https://api.github.com/users/petlys/gists{/gist_id}","starred_url":"https://api.github.com/users/petlys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petlys/subscriptions","organizations_url":"https://api.github.com/users/petlys/orgs","repos_url":"https://api.github.com/users/petlys/repos","events_url":"https://api.github.com/users/petlys/events{/privacy}","received_events_url":"https://api.github.com/users/petlys/received_events","type":"User","site_admin":false},"created_at":"2018-11-14T09:05:15Z","updated_at":"2018-11-14T09:05:15Z","author_association":"NONE","body":"> The WebView component is being extracted from the react native core into a separate repository. Could you check if you still have this issue when you use \"react-native-webview\" as a dependency instead of the soon to be deprecated Webview from rn? If so, please post this issue on that repo as you'll get a fix/answer sooner.\r\n\r\nThank you for the response. It does indeed work with `react-native-webview` 👍 \r\nHowever, I experience the same issue as listed here: https://github.com/react-native-community/react-native-webview/issues/136"}}
{"actor":{"display_login":"petlys"}}