[Discussion] How to extend existing Core Components in React-Native?
See original GitHub issueSo, I have written a library, react-native-webview-bridge, for WebView to handle message passing between React-Native and Javascript in WebView. It is based on WebViewJavascriptBridge.
So since there is no way to extend WebView.ios.js
, I ended up copying the source code and renamed and modified it, which is not ideal. What I want is a way to extend a React-Native’s Core Components.
I’m looking for some suggestions to guide me through this. How would you guys extend the Core Component? Is it actually possible to extend any React’s implementation?
Just to be clear, I am talking about the Javascript portion of React-Native’s Components not the objective-c part.
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Composition vs Inheritance - React
React has a powerful composition model, and we recommend using composition instead of inheritance to reuse code between components.
Read more >Components and Props - React
Components let you split the UI into independent, reusable pieces, and think about each piece in isolation. This page provides an introduction to...
Read more >Higher-Order Components - React
Concretely, a higher-order component is a function that takes a component and returns a new component. const EnhancedComponent = higherOrderComponent( ...
Read more >React Components, Elements, and Instances – React Blog
In this traditional UI model, it is up to you to take care of creating and destroying child component instances. If a Form...
Read more >React.Component
The only method you must define in a React.Component subclass is called render() . All the other methods described on this page are...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@alinz do you have an example of how this could translate for Android?
Currently there are a couple of ways to do this, that I know of: