react-native/React
PJ Cabrera 7882506c75 Send the evaluation of the injectedJavaScript prop back to the React Native side
Summary: We have a use case in the development of our app, where we are rendering some HTML content in a web view. But this content comes from the back end, and varies in height. There are other components on the page, so it's not a full screen web view. We need to dynamically alter the web view height, to fit the HTML content without scrolling, and to push the non-web view content on the screen down.

The solution I came up with, was to use the _loadingFinish callback, to send the evaluation of the injectedJavaScript property back to the React Native side. In my example above, injecting 'document.getElement(elementId).offsetHeight' evaluates to the height of the element, with margins and borders applied, and once returned to the RN app, it can change the app state and cause the web view height to be adjusted.
Closes https://github.com/facebook/react-native/pull/2753

Reviewed By: svcscm

Differential Revision: D2578688

Pulled By: mkonicek

fb-gh-sync-id: fc9c0d0f84994a409e037016a555534549f8957a
2015-10-23 20:24:26 -07:00
..
Base Introduce Perf Monitor 2015-10-23 10:56:56 -07:00
Executors Measure script conversion time in RCTPLScriptExecution 2015-10-22 06:41:28 -07:00
Layout Fix width being ignored when has a value of 0 2015-09-25 15:42:21 -07:00
Modules Introduce Perf Monitor 2015-10-23 10:56:56 -07:00
Profiler Introduce Perf Monitor 2015-10-23 10:56:56 -07:00
React.xcodeproj Introduce Perf Monitor 2015-10-23 10:56:56 -07:00
Views Send the evaluation of the injectedJavaScript prop back to the React Native side 2015-10-23 20:24:26 -07:00