All Questions
929
questions
413
votes
11
answers
399k
views
where is create-react-app webpack config and files?
I create a ReactJS project with the create-react-app package and that worked well, but I cannot find webpack files and configurations.
How does react-create-app work with webpack? Where are the ...
140
votes
8
answers
84k
views
webpack can't find module if file named jsx
As I write webpack.config.js like this
module.exports = {
entry: './index.jsx',
output: {
filename: 'bundle.js'
},
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /...
132
votes
5
answers
224k
views
How to store Configuration file and read it using React
I am new on react.js I have implemented one component in which I am fetching the data from server and use it like,
CallEnterprise:function(TenantId){
fetchData('http://xxx.xxx.xx.xx:8090/...
13
votes
2
answers
2k
views
When should I use brackets with imports
I have two file, the first one is todoHelper.js
it has export const addTodo = (list, item) => [...list, item]
later on I want to use addTodo in another file, I simply do import {addTodo} from './...
240
votes
14
answers
388k
views
How to make the webpack dev server run on port 80 and on 0.0.0.0 to make it publicly accessible?
I am new to the whole nodejs/reactjs world so apologies if my question sounds silly. I am currently playing around with reactabular.js.
Whenever I do a npm start it always runs on localhost:8080.
How ...
155
votes
6
answers
399k
views
How to import and export components using React + ES6 + webpack?
I'm playing around with React and ES6 using babel and webpack. I want to build several components in different files, import in a single file and bundle them up with webpack
Let's say I have a few ...
152
votes
8
answers
239k
views
Is it possible to use dotenv in a react project?
I am trying to set some environment variables (for making API calls to dev/prod endpoints, keys depending on dev/prod, etc.) and I'm wondering if using dotenv will work.
I've installed dotenv, and I ...
91
votes
8
answers
261k
views
"You may need an additional loader to handle the result of these loaders."
I am currently trying to build a State Management Library for ReactJs. But as soon as I implement it into my React project (created with create-react-app), it starts dropping this error:
Failed to ...
68
votes
11
answers
96k
views
Remove console.logs with Webpack & Uglify
I am trying to remove console.logs with Webpack's Uglify plugin but it seems that Uglify plugin that comes bundled with Webpack doesn't have that option, its not mentioned in the documentation.
I am ...
52
votes
11
answers
68k
views
How to setup apache server for React route?
I have my react app running great on my local dev server but it did not work when I dump my production ready files straight into Apache's htdocs directory:
Here is what I have:
/var/www/index.html
/...
267
votes
27
answers
576k
views
Typescript react - Could not find a declaration file for module ''react-materialize'. 'path/to/module-name.js' implicitly has an any type
I am trying to import components from react-materialize as -
import {Navbar, NavItem} from 'react-materialize';
But when the webpack is compiling my .tsx it throws an error for the above as -
ERROR ...
82
votes
9
answers
96k
views
How should I configure create-react-app to serve app from subdirectory?
I have classic web application rendered on server. I want to create admin panel as single page application in React. I want to server admin panel from https://smyapp.example.com/admin/. I try to use ...
61
votes
11
answers
137k
views
Unable to load images from static folder
How can I load images in a component in Next.js? Do I have to build the project first? If yes, is there a way to load the images without building first? I cannot get this to work, no matter what I try....
45
votes
6
answers
102k
views
IMAGE: You may need an appropriate loader to handle this file type
I can't figure what is the proper loader to load images in ReactJS webpack,
May you give me a hand?
I get this error:
Module parse failed: /Users/imac/Desktop/fakeeh/imgs/logo.png Unexpected ...
199
votes
11
answers
130k
views
How to tell webpack dev server to serve index.html for any route
React router allows react apps to handle /arbitrary/route. In order this to work, I need my server to send the React app on any matched route.
But webpack dev server doesn't handle arbitrary end ...