Error when I try importing a react-admin component - react-admin

The react-admin application is showing me this error:
Attempted import error: 'useRecordContext' is not exported from 'react-admin'.
This error happens when I'm trying to import a react-admin component or hook react-admin, something like the next image:
enter image description here
So let me know please if I have to update react-admin versiĆ³n or anything else, I'm currently using these dependencies according to next image:
enter image description here

You're using react-admin 3.5, and useRecordContext didn't exist back then.
I don't know where you found the docs for this hook. I advise you to select the version you're using in the react-admin documentation (in your case, https://marmelab.com/react-admin/doc/3.13/Tutorial.html) - there, you'll only see the hooks and components available in your version.
Also, react-admin 3.5 is more than 2 years old. 20 minor versions and one major version were published since then. I strongly advise you to upgrade.

Related

Vue 3 okta-vue auth

I'm migrating Vue2 to Vue3 and fix a lot of errors.
This error made me to stuck at the progress of migrating and I'm actually need help.
The Error:
enter image description here
While searching in google I have found that lines of code did the error:
enter image description here
And after understand why actually this happened, I recognized that plugin cannot compiled with Vue 3, but I really don't know how to solve this
Plugin:
enter image description here
Someone know how to migrate this part to Vue 3 syntax? or maybe someone know this error and can tell me what to do next?

Hicharts graph zoom on react native

I used Highcharts on my project in mobile react native and found after trying to pinch-to-zoom on graph x-axis and y-axis are not refreshing to shows smaller x-coordinate numbers.
However when I used to work in Expo, it was properly worked and showing correct number during pinch-to-zoom.
Please advise if you ran into same issue and how you fixed it? I am guessing there should be an event needs to be trigger to refresh charts.
Tried to use Highcharts zoon feature on react native code for my graph, expecting to see smaller numbers of X and Y axis on graph after pinch-to -zoom
I have found, that you have already asked your question on Freshdesk, our support channel. In the future, please do not duplicate topics across our support channels, as we work as a single team of developers.
The React-Native package is deprecated, so that means, that we dropped support for that package, and it now is in hands of the community. If you need any support with this package, you can create an Issue in GitHub and might find some help there. Alternatively, you can try to search for some new package, which is not official. On the other hand, you can try to use methods, like chart.redraw (https://api.highcharts.com/class-reference/Highcharts.Chart#redraw) or chart.reflow (https://api.highcharts.com/class-reference/Highcharts.Chart#reflow) - they are responsible for redrawing/reflowing the chart, which will refresh the chart.

Create a custom date picker with react native and expo

I would like to create a box to select the date as in the attached photo.
What do you recommend to create something similar in react native with expo?
I tried using MUI's Mobile DatePicker API, but it doesn't work, errors occur.
Update:
I created this box to select the date, but when I go to press it gives me an error.
The error is the following:
https://www.npmjs.com/package/#react-native-community/datetimepicker
Works with Expo. Static version set at 3.x.x (something version 3). So you won't have the full functionality that is described on their docs, but you'll have enough.
expo install #react-native-community/datetimepicker
instead of npm to ensure you get the compatible version.
This library can be a bit difficult to work with. The main suggestion I have for you is to create a custom component on your own that looks like your design. Then wrap it with a TouchableOpacity and onPress set the DateTimePicker to show its modal. Grab the value you need from the onChange result, and pass it to your local state. Dont try anything fancy after that because as I mentioned earlier, the library is difficult to work with and really fights hard against any customization. It works well though and will certainly solve your problem.

withNavigationFocus React-Navigation alternative for class component after upgrade from 3.x to 6.x

I am currently updating the version of my application, and I have a function that is used that no longer exists, I tried several things according to the documentation
but I get either an "Invalid Hook Call" error or something else...
The problem without the withNavigationFocus function is that when the screen is rendered, the data is not displayed. I have to press Cmd+S to refresh and have the data on the screen. Knowing that the props are linked to Redux.
This is the line that causes the problem:
export default withNavigationFocus(connect(mapStateToProps, mapDispatchToProps)(Home));
I can't find an alternative so far, does anyone have an idea?
Upgrade doc link here
You can install a backward compatibility package and you can continue to use HOCs withNavigation and withNavigationFocus.
Inpm install #react-navigation/native#^5.x #react-navigation/compat#^5.x #react-navigation/stack#^5.x
It was designed with React Navigation 5. I didn't test with version 6

error while updating property of 'selection' of a view managed by: androidTextInput

Getting following error on android, IOS work fine,
Using React Native Version 0.43.4
error while updating property of 'selection' of a view managed by:
androidTextInput
https://github.com/facebook/react-native/pull/22723
Please upgrade to the latest react native version as it has recently been updated with this pull request
Here's a work around if you cannot update RN:
https://github.com/akalin-keybase/rn-text-input-bugs/blob/master/App.js.
Basically this enforces the selection change before text change (whenever rerendering is called) see _onButtonPress() in the github page above.