-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Support React Native #593
Comments
Just discovered this repo: https://github.com/lightningtgc/react-native-material-ui |
Thanks @chadobado - We've talked about it for sure and it would be a fun project to start. However, we've got our hands full with this project at the moment. I'll keep this issue open and update if we ever create a native library. |
This is actually a great idea. I have tried to test porting |
Couldn't we use a babel-plugin-transformer to do it?
Do you have a demo project? |
I'm not sure as the stylesheet of React Native is quite different from CSS so it'll be quite complicated to make the transformer.
Not yet cause' I'm quite busy but I'll try to show you a small demo soon. Stylesheets let styles = {
root: {
zIndex: 5,
width: '100%',
display: '-webkit-box; display: -webkit-flex; display: flex',
minHeight: themeVariables.height,
backgroundColor: themeVariables.color,
paddingLeft: spacing.desktopGutter,
paddingRight: spacing.desktopGutter,
}
} to let styles = StyleSheet.create({
root: {
// zIndex: 5, (not supported)
//width: '100%', (number only)
//display: '-webkit-box; display: -webkit-flex; display: flex', (React Native always use Flex)
minHeight: themeVariables.height,
backgroundColor: themeVariables.color,
paddingLeft: spacing.desktopGutter,
paddingRight: spacing.desktopGutter,
}
}) JSX <div {...other} style={this.prepareStyles(styles, style)}>
<h1 style={styles.text}>Hello world</h1>
</div> to <View {...other} style={this.prepareStyles(styles, style)}>
<Text style={styles.text}>Hello world</Text>
</View> We also need to modify |
I just publish a WIP forking to react-native in https://github.com/lenaten/material-ui-native. |
@lenaten Interesting! When it's answered, I think that we could merge your fork back here. |
Material-UI is mature project against mrn project that misses a lot of material components. If my POC will work as excepted, merge it to cross platform file structure should be easy. I have no time to reinvent the wheel and start from scratch project. Anyway, your help in thoughts and code is very welcome. |
@oliviertassinari Me, too. My idea to make
or we can still use the same components for both browser and native and then write a wrapper to handle them. For example, div.browser.jsx export class ... {
render() {
return </div>
}
} div.native.jsx export class ... {
render() {
return </View>
}
} app-bar.jsx import {div} from "div" We can actually create a separated project for this wrapper. |
@quanglam2807 I'm glad to hear it. Regarding the code organisation, I like the idea of having separate file extensions. Regarding the project organisation, I may have changed my mind. To begin with our components. |
@oliviertassinari I also love the idea of "file extension" model. The most important to me now, is working native components. If you want to help with code abstraction you welcome. I commits to remove the "native" suffix from the repo name :) |
@lenaten is material-ui-native compatible with tcomb-form-native, or if not, how big a project would that be? |
@mvayngrib I stopped to work on this project for a while.. |
@lenaten that's a shame, thanks for responding |
Alright, I have started working in this #2611. That's going to take some time! |
@oliviertassinari awesome! very very excited |
so is the port endeavor still open? If so what was the settled on process to implementing components? |
@dorthwein It's still open. From my point of view, the process is the following:
|
@oliviertassinari - I can contribute a little bit of time porting some of the components over once the way forward is set. Looking at your list the only unknown right now is the react-look stuff right? |
@dorthwein we are happy to hear it. |
@oliviertassinari @dorthwein I am happy that this effort (that is, bringing |
@oliviertassinari I saw in another thread if supporting iOS made sense for this port - I think it absolutely does especially when you look at how Google Maps & other Google Material + iOS apps are out there. Where it makes sense and there is a strong pre existing iOS component (e.g. switches) it should use to the iOS switch on iOS. Implementing Android & iOS isn't much of a burden as well. |
@oliviertassinari The component.native.js, component.android.js, component.ios.js file structure also seems to make the most sense to me. |
@oliviertassinari I tried getting the docs up and running no luck. Few issues:
|
@dorthwein Thanks for the feedback. The react-native branch is highly experimental. We need to solve this. |
Yeah so the next stage of my current project is working on a mobile app using material design - I'd like to use this as all our web stuff is in this as well. If we can get a working environment going I'll start knocking it out along with our project. |
There's also the lesser known Carbon UI if you're going universal. But for my time I'd probably stick to one of these. |
its been touched on a couple of times in this thread, but i want to call it out again because of how it impacts my interest in this change: the main benefit of react-native support that i see isn't actually about react-native, but instead about being built on the primitives that enable the same components to be used on both native and web. if that type of primitive were used, other tools like react-sketchup and react-pdf could also be enabled. personally, those are more interesting to me than native, but would be enabled by the same changes. |
@JHabdas How is ur experience using Carbon UI ? Bcz to me it looks pretty good but didn't use it yet. |
@deadcoder0904 haven't used it yet personally. probably try reaching out to one of the guys at infinite red. they run the RN newsletter and should be the subject-matter experts. if and when I do build another RN app (okay, when...) I won't be clobbering things together this time or building another boilerplate—IMHO the space is solved by existing boilerplates and components. |
Here are some of the hurdles that I can think of that would need to be overcome to make MUI available in React Native. Assuming v1 MUI and we keep JSS, the
|
Today v1 released so what are the plans of React Native❓ For React Native Material Support, there is a beautiful library called React Native Paper which will be maintained & supported by CallStack team. But are there any plans to port this to React Native because I think Paper works perfectly fine❓ If not, then you can probably close this issue :) |
Thanks for sharing @deadcoder0904. I've added Paper to Awesome React Components. Haven't heard of CallStack. At first I read it as Call-Em-All. Guessing they're not the same peeps, ya? |
@JHabdas Nope they're not same |
@dantman Here are my thoughts on the best way to go about achieving native support
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@oliviertassinari I intend to fork and start exploring the implementation path I outlined above. My priority is going to be getting the components I need for another project working, so I probably won't be PRing robust React Native support anytime soon, but I'll try to keep it "in sync" with master as much as I can in hopes it'll one day be useful (or possibly merged) |
@micimize Thanks for letting me know. I wish you good luck in this project! :) Regarding why we haven't been working on react-native yet. I think that it comes in different flavors. Most importantly, we have no core maintainer interested in doing such. I can understand it, react-dom usage grows faster than react-native and it's hard. |
Update on this: We migrated a substantial chunk of functionality to a somewhat-usable state, including lists, buttons, cards, icons, selection controls, text fields, and backdrop. Unfortunately, once we were finally developing our app itself on react-native, a multitude of issues cropped up and compelled us to move to Flutter. At some point I would like to go back and salvage some of the work we did, chiefly the port of |
@rogerstorm funded this issue with $200. See it on IssueHunt |
Working on the problem would be an opportunity cost for us. So far, we are spread too thin. I'm closing. We will double down on better supporting the browser use cases. Once we nail this, then we can expand our focus. |
@oliviertassinari , does it mean that react native support is out of scope and in near future (e.g. 1 year) it won't be on radar? |
Correct. We don't have a funding model that can currently sustain it, e.g. https://npm-stat.com/charts.html?package=react-dom,react-native. |
Absolutely beautiful library. Any plans to port it to React-Native in the future?
Benchmarks
The text was updated successfully, but these errors were encountered: