create-react-app

How can i fix @fontface issue in my react application?

一笑奈何 提交于 2021-01-27 09:02:19
问题 I am facing an issue with custom fonts. I have created an app using create-react-app and provided the custom font files (.ttf) in public folder so that while building the app, all assests are part of the build. I am able to see the font on my local but not on nginx server. Nginx server has the .ttf support since another application is working fine. What should be the miss? I am not able to find it. Also, firefox is not able to load the same custom font. Here is my stylesheet - @font-face {

How can i fix @fontface issue in my react application?

只愿长相守 提交于 2021-01-27 09:01:35
问题 I am facing an issue with custom fonts. I have created an app using create-react-app and provided the custom font files (.ttf) in public folder so that while building the app, all assests are part of the build. I am able to see the font on my local but not on nginx server. Nginx server has the .ttf support since another application is working fine. What should be the miss? I am not able to find it. Also, firefox is not able to load the same custom font. Here is my stylesheet - @font-face {

How can i fix @fontface issue in my react application?

那年仲夏 提交于 2021-01-27 09:01:30
问题 I am facing an issue with custom fonts. I have created an app using create-react-app and provided the custom font files (.ttf) in public folder so that while building the app, all assests are part of the build. I am able to see the font on my local but not on nginx server. Nginx server has the .ttf support since another application is working fine. What should be the miss? I am not able to find it. Also, firefox is not able to load the same custom font. Here is my stylesheet - @font-face {

Upgrading From Create-React-App to Next.js - CSS stylesheets are not working

怎甘沉沦 提交于 2021-01-27 06:56:12
问题 Recently we found out that we have to use SSR for Our React Project. I have checked with every method that I know and almost tested all methods that I've found on medium and other sites. And after a lot of work, I decided that we have to migrate to Next JS. While the process of migrating everything is fine, but for the style sheets. In the old version of our app, we used webpack to bundle our styles with the project and everything was fine. This is the webpack.config.js const

Upgrading From Create-React-App to Next.js - CSS stylesheets are not working

不打扰是莪最后的温柔 提交于 2021-01-27 06:51:49
问题 Recently we found out that we have to use SSR for Our React Project. I have checked with every method that I know and almost tested all methods that I've found on medium and other sites. And after a lot of work, I decided that we have to migrate to Next JS. While the process of migrating everything is fine, but for the style sheets. In the old version of our app, we used webpack to bundle our styles with the project and everything was fine. This is the webpack.config.js const

How to inject dotenv variables without REACT_APP prefix in create-react-app?

不羁岁月 提交于 2021-01-27 06:10:57
问题 I have a project to migrate from legacy React app to standard create-react-app one (not ejected). In legacy project, it manually loads .env files with dotenv and dotenv-expand and injects through webpack DefinePlugin . create-react-app intuitively supports dotenv but can only recognize variables with REACT_APP_ prefix. There are so many places in legacy code also along with imported packages in other repositories that are using process.env.xxx variables, so it is impossible for now to rename

React global component

给你一囗甜甜゛ 提交于 2021-01-27 05:27:40
问题 I am coming from a vue.js background and I have just recently started looking into react. I have a component: PageContent.jsx and I wish to use it without constantly having to import it to be able to use it inside the render function (JSX). In vue it is possible to globalise a component using: Vue.component(componentName, componentObject) Is there anything similar in react? 回答1: Hmm, there isn't any kind of "global" component in React. Each component has to be imported or passed as a prop.

Definition for rule '@typescript-eslint/no-redeclare' was not found

倖福魔咒の 提交于 2021-01-27 05:09:14
问题 In all my .ts or .tsx files I have this warning on the first character in the file like in the screenshot below: I'm using a standard CRA setup. Here's my package.json : { "name": "my-project", "version": "0.1.0", "private": true, "dependencies": { "firebase": "^8.0.1", "formik": "^2.2.3", "i18next": "^19.8.3", "i18next-browser-languagedetector": "^6.0.1", "i18next-xhr-backend": "^3.2.2", "react": "^17.0.1", "react-dom": "^17.0.1", "react-firebaseui": "^4.1.0", "react-i18next": "^11.7.3",

Definition for rule '@typescript-eslint/no-redeclare' was not found

感情迁移 提交于 2021-01-27 05:08:01
问题 In all my .ts or .tsx files I have this warning on the first character in the file like in the screenshot below: I'm using a standard CRA setup. Here's my package.json : { "name": "my-project", "version": "0.1.0", "private": true, "dependencies": { "firebase": "^8.0.1", "formik": "^2.2.3", "i18next": "^19.8.3", "i18next-browser-languagedetector": "^6.0.1", "i18next-xhr-backend": "^3.2.2", "react": "^17.0.1", "react-dom": "^17.0.1", "react-firebaseui": "^4.1.0", "react-i18next": "^11.7.3",

Definition for rule '@typescript-eslint/no-redeclare' was not found

…衆ロ難τιáo~ 提交于 2021-01-27 05:06:52
问题 In all my .ts or .tsx files I have this warning on the first character in the file like in the screenshot below: I'm using a standard CRA setup. Here's my package.json : { "name": "my-project", "version": "0.1.0", "private": true, "dependencies": { "firebase": "^8.0.1", "formik": "^2.2.3", "i18next": "^19.8.3", "i18next-browser-languagedetector": "^6.0.1", "i18next-xhr-backend": "^3.2.2", "react": "^17.0.1", "react-dom": "^17.0.1", "react-firebaseui": "^4.1.0", "react-i18next": "^11.7.3",