react hide source code
in package.json file as follows.
add GENERATE_SOURCEMAP=false to build
scripts: {
"build": "GENERATE_SOURCEMAP=false react-scripts build"
}
react hide source code
in package.json file as follows.
add GENERATE_SOURCEMAP=false to build
scripts: {
"build": "GENERATE_SOURCEMAP=false react-scripts build"
}
How to hide component in React
import React, { useState } from 'react';
const Component = () => {
const [show, setShow] = useState(false);
return(
<>
<button onClick={() => setShow(prev => !prev)}>Click</button>
{show && <Box>This is your component</Box>}
</>
);
}
export default Component
hide react source
In in package.json (Windows)
"scripts": {
...
"cleanBuild": "rimraf ./build/*",
"build": "npm run cleanBuild && set \"GENERATE_SOURCEMAP=false\" && react-scripts build ",
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us