title: How to send parameter from React-Native to Native
body: <p>WebView.js</p>
  
  <pre><code>// WebView.js
  
  var PropTypes = require('ReactPropTypes')
  var React = require('React')
  import { requireNativeComponent } from 'react-native'
  
  var UIWebView = React.createClass({
  
    propTypes: {
      url: PropTypes.string
    },
  
    render () {
      return &lt;RCTUIWebView {...this.props} /&gt;
    }
  })
  
  var RCTUIWebView = requireNativeComponent('RCTUIWebView', UIWebView)
  
  module.exports = UIWebView
  </code></pre>
  
  <p>RCTUIWebViewManager.h</p>
  
  <pre><code>//  RCTWebViewManager.h
  
  #ifndef RCTUIWebViewManager_h
  #define RCTUIWebViewManager_h
  
  #import &lt;UIKit/UIKit.h&gt;
  #import "RCTViewManager.h"
  #import &lt;UIView+React.h&gt;
  
  @interface RCTUIWebViewManager : RCTViewManager
  
  @end
  
  #endif /* RCTViewManager_h */
  </code></pre>
  
  <p>RCTWebViewManager.m</p>
  
  <pre><code>//  RCTWebViewManager.m
  
  #import "RCTUIWebViewManager.h"
  #import "RCTUIWebView.h"
  
  #import "RCTBridge.h"
  #import "RCTEventDispatcher.h"
  #import "UIView+React.h"
  
  @implementation RCTUIWebViewManager
  
  RCT_EXPORT_MODULE()
  
  RCT_EXPORT_VIEW_PROPERTY(url, NSString);
  
  - (UIView *)view
  {
  
    RCTUIWebView *rctuiwebview = [[RCTUIWebView alloc] init];
    return [rctuiwebview getWebView];
  
  }
  
  @end
  </code></pre>
  
  <p>RCTUIWebView.h</p>
  
  <pre><code>// RCTUIWebView.h
  #ifndef RCTUIWebView_h
  #define RCTUIWebView_h
  
  #import &lt;UIKit/UIKit.h&gt;
  #import &lt;UIView+React.h&gt;
  
  @class RCTUIWebView;
  
  @interface RCTUIWebView : NSObject
  
  @property (nonatomic, copy) NSString *url;
  //@property (nonatomic, assign) NSString *uri;
  
  - (UIWebView *) getWebView;
  
  @end
  
  #endif /* RCTUIWebView_h */
  </code></pre>
  
  <p>RCTUIWebView.m</p>
  
  <pre><code>// RCTUIWebView.m
  
  #import &lt;Foundation/Foundation.h&gt;
  
  #import "RCTUIWebView.h"
  
  #import "RCTBridge.h"
  #import "RCTEventDispatcher.h"
  
  @implementation RCTUIWebView
  
  NSString *URL = @"http://www.baidu.com";
  
  - (void) setUrl:(NSString *)url {
    URL = url;
  }
  
  - (UIWebView *) getWebView {
    UIWebView *webview = [[UIWebView alloc] init];
    NSURLRequest *request =[NSURLRequest requestWithURL:[ NSURL URLWithString: URL]];
    [webview loadRequest:request];
    return webview;
  }
  
  @end
  </code></pre>
  
  <p>I tried to render it with parameter 'url';</p>
  
  <pre><code>var BrowserView = require('./WebView')
  &lt;BrowserView
    style={{width: 400, height: 500}}
    url={this.state.event.landingPage}
  /&gt;
  </code></pre>
  
  <p>It shows </p>
  
  <blockquote>
    <p>"Exception thrown while executing UI block: - [UIWebView setUrl:]:
    unrecognized selector set to instance 0x7fcf2de1e180" </p>
  </blockquote>
  
  <p>in the stimulator and shows </p>
  
  <blockquote>
    <p>"[error][tid:main][RCTNavigator.m:514] Error
    setting property 'url' of RCTUIWebView with tag #328: Error setting
    property 'url' of RCTUIWebView with tag #333: Cannot adjust current
    top of stack beyond available views"</p>
  </blockquote>
  
  <p>in Xcode console.</p>
  
  <p>I can't figure out why!</p>
  
  <p>If I modified render part:</p>
  
  <pre><code>var BrowserView = require('./WebView')
  &lt;BrowserView
    style={{width: 400, height: 500}}
    //url={this.state.event.landingPage}
  /&gt;
  </code></pre>
  
  <p>It's fine.</p>