Comments (8)
In case anyone else still experiences problems with the above, I found the secret sauce for me was:
"transformIgnorePatterns": [
"node_modules/(?!(jest-)?react-native|@react-native-community|@react-native-picker)",
],
from picker.
Still seeing this issue, even if using transformIgnorePatterns
from picker.
I added this to my package.json
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!(react-native|react-native-vector-icons|@react-native-community/picker)/)"
],
}
After adding this, you'll get this error: TypeError: Cannot read property 'default' of undefined
. To solve it go to node_modules/@react-native-community/picker/js/PickerIOS.ios.js
and add a constructor to the PickerIOS component:
class PickerIOS extends React.Component<Props, State> {
_picker: ?ElementRef<RNCPickerIOSType> = null;
+ constructor(props) {
+ super(props)
+ }
state = {
selectedIndex: 0,
items: [],
};
// ...
from picker.
Thanks @HugoLiconV, adding constructor was not required but adding @react-native-community/picker
to transformIgnorePatterns
helped.
from picker.
In case anyone else still experiences problems with the above, I found the secret sauce for me was:
"transformIgnorePatterns": [ "node_modules/(?!(jest-)?react-native|@react-native-community|@react-native-picker)", ],
Make sure you add this under "jest" in package.json or jest config
Works for me. Thanks
from picker.
To fix the unexpected token error, I updated the config-overrides.js with:
module.exports = override(
babelInclude([
...
path.resolve('src'),
path.resolve(__dirname, 'node_modules/@react-native-picker/picker'),
]),
);
from picker.
Just in case it helps. I had the same issue because I was using expo-image-picker
my solution was to also ignore expo-modules-core
.
from picker.
Just in case it helps. I had the same issue because I was using
expo-image-picker
my solution was to also ignoreexpo-modules-core
.
I was seeing this issue without using expo-image-picker
.
from picker.
Related Issues (20)
- Picker is ALWAYS getting system theme (at least in Windows) HOT 1
- themeVariant is Not Working HOT 1
- Do not use this repo HOT 2
- bug: don't work: no label and no value HOT 8
- TypeError: Cannot read property 'Picker' of undefined HOT 2
- Picker 2.6+ transforms numeric values to strings HOT 4
- Selected value jumps back to first value when "Done" is tapped - Picker library v2.6.1, iOS only HOT 3
- @react-native-picker/picker could not be found within the project or in these directories
- react-native 0.71.8 with @react-native-picker/picker HOT 3
- can't remove gray background on IOS picker HOT 1
- On iOS, the value selected in onValueChange comes in null
- Picker Item is not listed on IOS HOT 9
- Border styles is not working HOT 1
- the problem of selectionColor HOT 3
- New version(2.7.0) compile time issue in android | Keeps app crashing HOT 3
- Facing Error when create debug app build: public record ReactPickerLocalData(int height) { ^ (use -source 16 or higher to enable records) HOT 4
- Error after npm run android HOT 2
- Run Android triggers Execution failed for task ':app:mergeLibDexDebug'
- how to disable font scaling of @react-native-picker/picker HOT 1
- Attempt to invoke interface method 'com.facebook.react.bridge.ReadableNativeMap com.facebook.react.uimanager.StateWrapper.getStateData()' on a null object reference HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from picker.