You can export const but not default for some reason

const is like let, it is a LexicalDeclaration (VariableStatement, Declaration) used to define an identifier in your block.

You are trying to mix this with the default keyword, which expects a HoistableDeclaration, ClassDeclaration or AssignmentExpression to follow it.

Therefore it is a SyntaxError.

If you want to const something you need to provide the identifier and not use default.

export by itself accepts a VariableStatement or Declaration to its right.

How best to fit an image into a div

https://stackoverflow.com/questions/3029422/how-do-i-auto-resize-an-image-to-fit-a-div-container

Upgraded everything, hashbrowser, making my router refresh correctly

Many things were attempted, fixes to the back

var path = require(‘path’);

var SRC_DIR = path.join(__dirname, ‘/client/src’);

var DIST_DIR = path.join(__dirname, ‘/client/dist’);

module.exports = {

mode: ‘development’,

entry: `${SRC_DIR}/index.js`,

output: {

filename: ‘bundle.js’,

path: DIST_DIR,

publicPath: “/”,

},

devServer: {

historyApiFallback: true,

If another page is importing a string that is the keyof something

It needs the reciprocal thing

<AdminGreaterThan0 formValues={prop.formValues} valueToBeChecked={‘max_cycles’ as keyof addPromotion}/>

Instead of string, this would be keyof. If not, typescript can only conclude that this is a string and can’t match properly on the other importing end

Dec 17

Today I learned that the value property in many things were not needed. It did it automatically and I should not have bothered with the other stuff either

Element implicitly has an ‘any’ type because expression of type ‘TransitionStatus’ can’t be used to index type ‘{ entering: { opacity: number; }; entered: { opacity: number; }; exiting: { opacity: number; }; exited: { opacity: number; }; }’.

Property ‘unmounted’ does not exist on type ‘{ entering: { opacity…

label={

<div className={classes.icon}>

<span>My Label</span>

<HelpOutlineIcon />

</div>

}

Mistakes made. Recently, I made an array instead of an object. I think it was because I was worried about the map property since that can also be used for arrays. In retrospect, it may be better to just keep such items as objects for quick lookups and then keep fixing

var myObject = { 'a': 1, 'b': 2, 'c': 3 };

Object.keys(myObject).map(function(key, index) {
myObject[key] *= 2;
});

console.log(myObject);
// => { 'a': 2, 'b': 4, 'c': 6 }

<Typography variant=”caption”>

Photography <HelpOutlineIcon style={{ position: ‘relative’, top: ‘8px’ }} />

</Typography>

This is one way to get an image and text to line up. Both position and top are important. Top will apply from the top of this line allowing the image to line up correctly. Position relative is…

Jesse Chung

Starting a tech bootcamp

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store