2018-10-22         Lydia

How to include TouchableOpacity within Text ReactNative

Hi I want to wrap TouchableOpacity within a Text as I want to make some of the text clickable. When I wrap everything within a Text it looks perfect and that is how I want it to look. <Text style={{color: colors.black, fontSize: 12, fontWeight: 'normal', marginTop: 10, lineHeight: 18}}> {strings.loginPrivacyTermsCondOne} <Text style={{color: colors.primaryColor, fontSize: 12, fontWeight: 'normal',}}> {strings.loginPrivacyTermsCondTwo} </Text> ...

 reactjs                     1 answers                     3 view
 2018-10-22         Hazel

Cannot access bundle.js, when url is multiple layers deep

bundle.js works on localhost:3000/abc (because it looks in the localhost:3000/assets folder), but if I go to localhost:3000/abc/xyz I get a 404 (because it looks in the localhost:3000/abc/assets folder).My webpack.config.jsvar webpack = require("webpack");var path = require('path')module.exports = { entry: "./src/index.js", output: { path: path.join(__dirname, '/dist'), filename: "bundle.js", publicPath: "/assets/", }, devServer: { inline: true, contentBase: "./dist", port: 3000, historyApiFallback: true, }, ...

 reactjs                     1 answers                     75 view
 2018-10-22         Stanford

How to upgrade to babel 7

I tried to upgrade Webpack and babel to 4, 7 respectively but couldn’t make it work. Also the official doc isn’t helping much with the upgrade I am getting following issue compiler error: ERROR in Cannot find module '@babel/core' @ multi maindependencies I am using:"babel-core": "^6.26.3","babel-eslint": "^9.0.0","babel-loader": "^8.0.0","babel-plugin-transform-class-properties": "^6.24.1","babel-plugin-transform-object-rest-spread": "^6.26.0","babel-polyfill": "^6.26.0","babel-preset-env": "^1.7.0","babel-preset-react": "^6.24.1","webpack": "^4.15.0","webpack-cli": "^3...

 reactjs                     1 answers                     77 view
 2018-10-22         Renata

Using Collections to enrich GetStream.io feed activity

I am developing a React Web App with GetStream at the core. I have been reviewing Collections. I was wondering if/how it can be used to enrich feed/activity data if I was to "upsert" user profile and product information. We are launching a new version of the JS client that performs enrichment out-of-the-box using Stream's collections as data storage. This feature is currently in beta/stealth mode and yet to be documented but it is ready and fully functional. If you are willing to read some code and test it, you can try it out by installing the latest beta from npm (eg....

 reactjs                     1 answers                     13 view
 2018-10-22         Maureen

Need to host the blog along with the main site in the same S3 bucket

We have our main website (which is in React) served from a S3 bucket. Since we need to serve the blog (which is in jekyll) as well from the same domain (i.e. mainsite.com/blog) for SEO purposes we have included the files of blog in the same S3 bucket in a separate folder called blog. Now in the main site we have added an anchor tag to direct the user to blog. <a className="ml-nav-item" href="blog/index.html" target="_blank" rel="noopener noreferrer"> Blog </a>In your question it self answer also there. because for blog/index.htm...

 reactjs                     1 answers                     63 view
 2018-10-22         Andy

Blank page after successful Firebase deployment

My ReactJs application runs fine on my local box, when I use the npm start command. However when I try to deploy my application using the firebase init to Firebase, I am seeing a blank page. What could I be doing wrong? Update: I had to edit the Firebase.json file to remove the "predeploy": ["npm --prefix \"$RESOURCE_DIR\" run lint"],line as I was getting errors related to that.Firebase.json:{ "database": { "rules": "database.rules.json" }, "firestore": { "rules": "firestore.rules", "indexes": "firestore.indexes.json" }, "functions": { "source": "functions"...

 reactjs                     3 answers                     66 view
 2018-10-22         Abbott

How to host a reactJS application

I am assuming I should be able to deploy my reactJS to an S3 instance on AWS but I do not know how to do this. I found publish-react-app on github and I am trying to follow those steps. When I execute npm run build I get this error stream:c:\jrs\PM_01\React>npm run buildnpm ERR! missing script: buildnpm ERR! A complete log of this run can be found in:npm ERR! C:\Users\jonat\AppData\Roaming\npm-cache\_logs\2018-09-05T18_57_19_811Z-debug.logc:\jrs\PM_01\React>npm run build> sample-app@1.0.0 build c:\jrs\PM_01\React> react-scripts build'react-scripts' is not ...

 reactjs                     1 answers                     86 view
 2018-10-22         Setlla

Best place to fetch data react google maps

I want to fetch Data and display in on react-google-mapshttps://tomchentw.github.io/react-google-maps/#googlemapThe thing is that in order to fetch data, I need the maps bound as a query and I only get map bounds on onIdleonIdle = () => { console.log('MAP IS READY'); console.log('GET BOUNDS IN ON IDLE: ', this.mapRef.getBounds()); }If I fetch data on onIdle, the component will update the map and call onIdle again. It causes an infinitive loop.My question is that what is the best place in react goole maps to fetch data (note that I need maps bounds). Or I just fetc...

 reactjs                     2 answers                     7 view
 2018-10-22         Steward

Import Semantic-ui css without the classes being scoped locally || Semantic-ui to use classes that are being scoped locally

I want to selectively use semantic-ui-css classes in my components. The problem is that I use PostCSS modules option which scopes locally all the class names for a specific component. When I use semantic-ui-react components, for example a button, it renders element button with classes ui button, but the included css gets scoped locally so instead of button i get button-min_ui__14RRq I need to do one of two things: Import Semantic-ui css without the classes being scoped locally Make Semantic-ui components to use classes that are being scoped locallyFor now I see that I have ...

 reactjs                     1 answers                     7 view
 2018-10-22         Natividad

Material-UI Button Component doesn't work properly after deploy on Github Pages

<Button href={node.slug}> <span>Read more</span></Button>So basically this is a button in a Card component, i don't think more code would present more meaning, please ask for more if needed. The node.slug variable is something like "product-name". In local environment works fine, but not after deployment on Github pages. This is a button on a product-category page(i.e. /tools or /maintenance), clicking the button the first time, takes me to:xxx.github.io/project-name/product-name/Issue is that after i go back and then click the button again, /produc...

 reactjs                     1 answers                     8 view
 2018-10-22         Page

Axios post with proxy on create-react-app hosting server doesn't work

I have following line in my package.json (react app)"proxy": "http://www.demoapp.com"I'm requesting data using REST-API callaxios.post('/user_data', { // http://www.demoapp.com/user_data id:id }) .then((response) => { console.log(response); }) .catch((error) => { });Above code works fine if I use it in my local system, But if I build a project and upload into hosting server proxy doesn't work.Anyone know the solution? I have checked in github also but not found proper solution. I think you should define your proxy in the axios config, ...

 reactjs                     1 answers                     18 view
 2018-10-22         Sharon

Update JSON state object problems

I am having difficulty updating my JSON state object. The basic premise behind my application is that I have a parent component with a child components embedded. Based on certain user interactions a child component will load in edit mode allowing the user to change fields in the form (otherwise its read-only).Based on changes in the child component form the changes are successfully being passed back to the Parent to the function (onOverviewChange). The fieldName and fieldValue seem to be getting passed back correctly, however I can't seem to update state with the new val...

 reactjs                     2 answers                     21 view
 2018-10-22         Olivia

Multiple get requests

I'm new with React and apis. I'm trying to make 2 get requests and assign 2 keys with their new values to "items" array. Here the "img" key coming from the second get request keeps overriding the whole object. So, it makes the first get request as if it doesn't exist. I need to just append the second key with the first key-values coming from the first fetch. Hope that does make sense. fetch(url,{ method: 'GET' }) .then((response)=> response.json()) .then((responseJson) => { const newItems = responseJson.items.map(i => {...

 reactjs                     1 answers                     75 view
 2018-10-22         Boris

Could not get uid/gid when building Node/Docker

My Dockerfile is using alpine and globally installing react-scripts. When it tries to install it, it fails with "could not get uid/gid" error. I added the "---unsafe-perm" option to the npm install -g command. The docker container is successfully created, but the permissions in the container are messaged up for the installed files. I see the username and group set to 1000 for all of them. I tried adding the following command to the Dockerfile right before the install step but that didn't help.RUN npm -g config set user rootBuild errorError: could not get uid/gid[ 'nobod...

 reactjs                     1 answers                     36 view
 2018-10-22         Judith

when I create a react app project with the create reaction app's npm command, my react devTool showing red

I have a doubt, when I create a react app project with the create reaction app's npm command npm init react-app my-app, it opens on the web page, why is my react devTool showing red? I just want to develop version debugging.enter image description here It is because you are in development mode and the dev extension give you a warning saying that is not a production build.This is not a problem if you are developing just make sure that when you deploy you have a production build.See instructions here [XXX]

 reactjs                     1 answers                     38 view
 2018-10-22         Laurel

Run two scripts that don't end in package.json

I'm trying to start a json-server and start my React-App in the same script in package.json ...But the problem is that none of the two scripts give me the prompt back so the second script is never launched ...I've tried :"scripts": { "start": "npm run start-db & npm start-react", "start-react": "react-scripts start && exit 1", "start-db": "json-server --watch src/bdd.json -p 3001 && exit 1"}with differents combinations of && or &... With or without exit 1 ( things that I found here ) you can use a tool like concurrently."scripts": { ...

 reactjs                     2 answers                     40 view

Page 1 of 540  |  Show More Pages:  Top Prev Next Last