Opinion on native base List component - react-native

I want to know that whether the <List> component being provided by native-base
styling library can be an alternative for <ListView> component.
I know that the the traditional listview by react-native is performance efficient
so is the List component of native base also performance efficient.

Check NativeBase Docs https://docs.nativebase.io/Components.html#list-def-headref
It says, List is deprecated

NativeBases List component is actually just a wrapper over React Native's ListView with some extra goodies included, so efficiency in terms of cell reuse, etc should be good.
See the source for List.

Related

Algolia for React Native: refine() method

I wish to use Algolia to setup InstantSearch in my React Native project. I am using this tutorial to learn the basics.
It appears in their RefinementList and InfiniteHits components there is a parameter: refine. This parameter seems to play a key role in the functionality of this tutorial's app.
Where can I get an example of how this refine() method would look like?
Please help me with some resources. An explanation of this refine() method would also help.
Thanks!
I think there's a typo in the documentation at the time of this writing (for which I opened a pull request), and the name of the actual prop is refineNext.
The documented InfiniteHits example from the React Native guide uses a connector, which is a lower-level abstraction allowing users to fully control the UI. This is what allows you to use React Native code for the UI while having access to the InfiniteHits data and logic. You can read more about the connectInfiniteHits connector in the documentation.
The provided refineNext function lets you load more results. It doesn't take any arguments, all you need to do is call it whenever you want to load more results from Algolia. In the example, it's being used in the onEndReached callback of React Native's FlatList component, whenever the hasMore provided prop is true. This allows loading more results once when the scroll position gets within onEndReachedThreshold of the rendered content.

Is there a simple way to change the chevron icons in a nested Nav component?

I personally and a lot of customers think the default icons for links with nested items in the Nav component are strange. Hence I want their look and behavior to change from this:
to this:
(In the screenshots the size is also different, but that's just from the context's I took them. I just want to change the icons).
The latter is btw also used by Microsoft OWA (Outlook Online), which also uses Fluent UI React. The only thing that I could come up with (but which doesn't work really well) was to hide the default chevron using styles and modifying the rendered link onRenderLink to display the other chevrons.
I'm aware of this question, but changing the icons via style is no option and I guess no longer a preferred way by fluent ui.
Is there any better or official way I'm missing?
I've taken a look at the code and unfortunately the icon is baked into the Nav component. Your best option would be to style the icon similar to what is being done in this codepen.

Change styles of third party components in react native

Very often I'm seeing that third party react native components don't provide granular access to changing their styles. On web we can target and style different parts based on their CSS classes. If a react native component does not provide enough props for changing styles, how to go about changing its styles?
It's common to me to read the third party lib code on github and then write a component that do the same thing but with my styles, Generally speaking it's not much complex depending on the library of course, for small libs it works very well.
It's only worth when the lib doesn't provide a way of overriding styles as you have pointed.
You also can see the style implementation of lib's main component and override it's styles, using JSS or styled-components lib.

Is there a way to enforce order of execution of props on a Native Component?

I came across a bug in a React Native app that makes use of a native view component, and tracked it down to the order of execution of the property settings methods (e.g. #ReactProp methods on Android).
I found that I had to put the prop method that needed setting first as the last prop in the component's JSX declaration, which is a little counter-intuitive.
Is there a way to enforce this order?
Although this doesn't specifically answer the question, one way around this, when specific props are dependent on each other like this, is to bundle them in an object, which on Android would be passed to the native method via a ReadableMap. That way all the dependent data is in one place and can be handled in the correct order.

'Global' modal in React Native

I'm building an app in React native, and basically, I need a modal(which will have the same content every time) to be available globally (in all components of app), so that I can be able to open it from anywhere in my app.
Obviously copy/pasting the same modal in all the components is not a good solution
Right now I'm having tons of trouble implementing it, so I would like to know what would be the best way to accomplish something like that
Use a Navigator and place your modal below it. Make it visible only when the state changes. The state can be changed from each component inside the Navigator via props.navigator.
You can see the full code with explanation here http://browniefed.com/blog/react-native-easy-overlay-modal-with-navigator/