-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
"What do you dislike about React Native Paper?" November 2019 Edition #1489
Comments
Dropdown/Select ComponentContentI'd love to see a select component from this lib. |
Stabilized ComponentsContentI've had a rough time getting Menu components (Menu, MenuItem, etc) to properly work. I will file a bug report in the issue tracker but I've had the following happen:
|
ThemingContentI'd love better theming options. For example, I'd love to do: <Button color="primary">Primary</Button>
<Button color="secondary">Secondary</Button> instead of: <Button color="#000">Primary</Button>
<Button color="#fff">Secondary</Button> |
CustomizationContentI'd like more customization e.g. 'View' as title <List.Accordion
title={titleProps => (
<View style={{ flexDirection: "row" }}>
<Text style={titleProps.style} numberOfLines={4}>
Nice text
</Text>
<TouchableRipple>
<Text>Edit</Text>
</TouchableRipple>
</View>
)}
/> Now I end up with forking react-native-paper to make some things possible. #993 -> https://github.com/profects/react-native-paper/blob/a18bdcd961e0aa596ed9355cdd0726c4c43e815a/src/components/List/ListAccordionRenderer.tsx |
I would love to be able to install individual components without importing the entire library. |
We have a babel plugin that removes not used components from bundle. Check this |
Just like there is an error prop in TextInput button that changes the border of the TextInput to red, I would like that there be another success prop that would change the border to green or any colour that I pass. It will make it more flexible. Currently, we've found that the way to change border colour of TextInput is through the More than the success prop, we would like to control the |
I would like to see a Date and Time Picker Component in this library, which will be compatible on both ios and android platform. It will be very helpful. |
I would like to be able to import Instead of import Icon from 'react-native-vector-icons/MaterialCommunityIcons' I could just import { Icon } from 'react-native-paper' |
More components, a slider for example! :) Maybe a Grid? |
Typescript suggestions for icon namesIf you give an icon an invalid name, you get an error telling you all of the available icon names: <Button icon="some-inexistent-name"></Button>
// Invalid prop `name` of value `some-inexistent-name` supplied to `Icon` It would be useful if the Also, in the error message, it would be useful to add a link to a website that has the available icon names. |
ExtraContentAdd auxiliary components. For example, keyboard management, theme change, or self-organizing picture component depending on width or height.
|
Non-component Snackbar like |
Check the docs. We do have a |
@Trancever Yeah! It's awesome but sometimes I want the option of calling it like |
I would like to see component Theme overrides to execute in a central spot, like in @material-ui instead of having to create local versions. |
@usmansbk that sounds more like program flow. You could implement this using AppContent or redux. |
I would like to call out the dropdown/select component from the react material-ui library for guidance. This is all written in js and is still smooth! (https://material-ui.com/components/selects/) |
@iamclaytonray @jstansbe Could you point me to the Material Design Guidelines page that describes a select component for Android? |
@Trancever I think there is no specific guideline how to make "select" component, it's more like extension of the "menu" component, which is called "Exposed dropdown menus": https://material.io/components/menus/#exposed-dropdown-menu There are though guidelines for pickers: https://material.io/components/pickers/#mobile-pickers And maybe sliders? https://material.io/components/sliders/ |
@zufarzhan You should be able to implement "Exposed dropdown menu" with |
@Trancever @zufarzhan I've used the menu component with the text input to create what you're describing... and it does work. But isn't this the equivalent to <List.Icon /> or <Card.Actions />? The user could easily combine a list item and icon just fine, but the value comes from react-native-paper's application of material guidelines. There is a ton of value in creating a dropdown (text input + menu)... this is also a component that is missing from other notable UI libraries and would help differentiate rnp from them. I'm not really aware of rnp's goals though, so maybe some of these points are irrelevant. Also, If it helps I can work on submitting a starting point (or work on the component throughout the conception=>release process). |
Can we limit these convos or bring them elsewhere? The RFC is going to get muddied up with convos vs clear points that the community wants. (Plus, I'm getting spammed with emails for an issue I want to subscribe to but not so much on side conversations) |
[Typescript] Some component prop types are not exportedI would like to extend import { TextInputProps } from 'react-native-paper/lib/typescript/src/components/TextInput/TextInput' This is very unsatisfying, because this path could change at any time and depends on your build logic. A tool such as Component props are obviously part of the API surface, and as such must be exported. |
One of the things I like about material-ui, is that the components are aggregated from sub components and these sub components are easily customizable. Since RN doesn't have the kind of style selectors available to style children It would make sense to me to expose these sub container style objects on the api so you can optionally override this. It's kind of an ugly solution though. I guess the overriding theme of my suggestions is: make it possible to easily deviate from default Material Design. |
It does not feel native. Ripple effect does not work on ios. |
Ripple EffectIt would be great if we could optionally disable or configure the ripple effect for different components. Option to disable rippleIn my case I think I would be fine with a Option to edit ripple effectI also am using the |
Each component is very limited, you can't edit e.g. IconButtons or there is no toggle switch button (like in rectangular shape). Today got bug IconButton because it is missing properties hasTVPreffered Focus and Properties..... but in the RNP docs doesn't say that it is required to call. Why? Why is this so painful to use this? |
A lot of components use In case anyone is looking to work around this for now: you can monkeypatch Code sampleif (!TouchableRipple._patched) {
const oldRender = TouchableRipple.render
TouchableRipple.render = function (props, ...args) {
const { colors } = useTheme()
props = {
...props,
rippleColor: colors.ripple
}
return oldRender.call(this, props, ...args)
}
TouchableRipple._patched = true
} |
|
Docs are pretty ugly. Could use some inspiration: https://reactnavigation.org/docs/getting-started/ |
2022 and still the same. Code above won't even work for all components, this makes it really hard to extend react-native-paper components. |
So I have: const fontConfig: Fonts = {
regular: {
fontFamily: 'Roboto-Regular',
fontWeight: 'normal'
},
medium: {
fontFamily: 'Roboto-Medium',
fontWeight: '500'
},
light: {
fontFamily: 'Roboto-Light',
fontWeight: '300'
},
thin: {
fontFamily: 'Roboto-Thin',
fontWeight: '100'
}
};
export const paperTheme: Theme = {
...DefaultTheme,
colors: {
...DefaultTheme.colors,
primary: primary,
text: text,
error: red,
accent: accent
},
fonts: configureFonts({
ios: fontConfig,
android: fontConfig,
web: fontConfig
})
}; however, if I do: <Text style={{ fontWeight: '500' }}>
Hello
</Text> It will only work for ios, it won't work for android, because in Android, I have to do: <Text style={{ fontWeight: '500', fontFamily: 'Roboto-Medium' }}>
Hello
</Text> For it to work. My current workaround is: import React from 'react';
import { TextStyle } from 'react-native';
import { Text as RNPText } from 'react-native-paper';
const fontConfigs: Record<string, TextStyle> = {
regular: {
fontFamily: 'Roboto-Regular',
fontWeight: 'normal'
},
medium: {
fontFamily: 'Roboto-Medium',
fontWeight: '500'
},
light: {
fontFamily: 'Roboto-Light',
fontWeight: '300'
},
thin: {
fontFamily: 'Roboto-Thin',
fontWeight: '100'
}
};
const Text: React.FunctionComponent<{
style?: TextStyle;
font?: keyof typeof fontConfigs;
}> = ({ children, font = 'regular', style }) => {
const styleFromFontConfig = fontConfigs[font];
return (
<RNPText style={[styleFromFontConfig, style]}>
{children}
</RNPText>
);
};
export default Text; Then I'll use this custom text instead of the one that RNP provides. |
It is extremely hard to extend components of RNP, it's my first time using RNP with TS, I used RNUILib before, and I didn't encounter these kinds of problems which I will consider BASIC. TextInput.tsx import React from 'react';
import {
HelperText,
TextInput as RNPTextInput
} from 'react-native-paper';
import { TextInputProps } from 'react-native-paper/lib/typescript/components/TextInput/TextInput';
import { flatten } from 'utils/arrays';
const TextInput: React.FunctionComponent<
{
error: string;
} & TextInputProps
> = ({ style, error, ...textProps }) => {
return (
<>
<RNPTextInput
mode="outlined"
style={flatten({ backgroundColor: '#fff' }, style)}
error={Boolean(error)}
{...textProps}
/>
<HelperText type="error">{error}</HelperText>
</>
);
};
export default TextInput; custom component above will produce: Doing: type Props = TextInputProps & {
error: string;
}; Produces: This is crazy. |
RNP IS VERY HARD TO USE WITH TS. |
@aprilmintacpineda While React Native Paper may not be perfect, your issues are resolvable. You may forcibly pull un-exported props out with the built-in type utility in React. import type { ComponentProps } from "react";
const MyTextInput: FunctionComponent<ComponentProps<TextInput>> = (...) => { ... }; When there are field conflicts, typescript will friendly reminds you that this type is not even possible by spitting out a You may remove the original fields you override with type Props = Omit<TextInputProps, "error"> & { error: string }; Or, depends on how you prepare to use your component, at least make yours compatible with the parent type: type Props = TextInputProps & { error: boolean | string }; |
Thanks for the insights, very helpful, I will try them out! EDIT: this worked for me: import { ComponentProps } from 'react';
import { TextInput } from 'react-native-paper';
type RNPTextInputProps = ComponentProps<typeof TextInput> |
I've only recently started using react-native and react-native-paper. RNP is great, easy to use, no cross-platform hiccups and performs as claimed in that way. The only issue I have is preferential and lies in the styling. I've been a user and proponent of styled-system/styled-components and anything built on those systems for years, because they simply make component customization incredibly fast. Everything is built with the same props using attributes to space, shape, color, whatever, as well as most components made with a grid system in mind. So this:
Becomes this:
In the same vein and based on the same styled-system, a Flex and Box grid system would be great using the same attributes in the button example. This example also illustrates the array based breakpoint system:
|
As some have mentioned, including #2529, it would be nice to be able to disable the ripple effect for touchable components. I tried making a simple software keyboard with I don't mind the ripple effect and I think having a way to make the ripple async so that |
can any one explain why the button label is not in ios. <Button its bold in android only....why is that...? |
The datatable are pain, the docs are useless. |
Are you working on select and Datepickers? |
No, datatables with fetched data. |
|
What grinds my gears the most is that React Native Paper 5 in theory supports both Material Design 2 and 3 but in practice what happens is the moment you actually switch to MD2, you're on your own. The documentation doesn't mention that there are major differences in how themes, components and sizings work (for ex. I just learned the hard way that |
ThemingImporting Generated ThemesIt would be great to be able to import Material Themes generated and exported using Material theme builder, namely some of
Or maybe this should be a feature request for material-theme-builder repo? What do you think makes more sense? |
Any progress on this? |
|
I'd love to see complete set of colors from Material You, I have created an issue here: #4343 Currently paper have this: |
Global Component props overrideFor example I want to override the If there is any way to do it now, please let me know, if no, then I guess it would be better to have it to override/set the component props just like overriding the theming. |
It would be very good to be globally editable like @mui |
Cupertino components for IOS (Just a suggestion or thought)Hello everyone. React native paper UI looks same on both android and ios. Do you guys have any plans to implement Cupertino components for IOS? This is a reference link Cupertino-Widgets-Flutter . On android it should use the material design and on IOS it should use Cupertino components. There should be a prop like |
Hello, I would like to confirm whether React Native Paper currently supports the Windows platform, specifically for desktop applications developed with React Native for Windows. If it does not, we would appreciate the ability to easily launch React Native Paper applications on the Windows platform. |
We, the React Native Paper core team, would like to get a current list of all the things that people are having problems with when using React Native Paper. This is first time we are running this community feedback gathering initiative, but we are planning to do it cyclically - twice a year. We hope this will help us better understand our users and prioritize the work for the upcoming 2020 year.
Please reply with all the issues that you are having with React Native Paper. Keep your descriptions short and ideally link to other places with more context. Feel free to mention not just technical things but rather any issue that can be ascribed to the React Native Paper project.
If something has been mentioned already, please use the upvote/emoji buttons instead of repeating the same thing so that it's easier to see how many people care about each issue. Please make one comment per topic so that people can upvote just one thing at a time.
Hypothetical Example:
Some of the animations are not native
That would be really nice if js based animations (e.g. Checkbox or RadioButton) were replaced with native ones. Please consider reimplementing animations with reanimated for better performance.
Simple template with header (feel free to copy and paste)
The text was updated successfully, but these errors were encountered: