Blog

  • TypeError: b.map is not a function

    If you’re building blocks for WordPress, and the error TypeError: b.map is not a function is logged in your browser’s developer console, you may have created a SelectControl component and failed to wrap the options in brackets to create an array.

    This code will cause the error:

    			<SelectControl
    				label="Minimum Rating"
    				value={ attributes.minimumRating }
    				options={ 
    					{ label: 'Great Deal', value: 'GREAT_PRICE' },
    					{ label: 'Good Deal', value: 'GOOD_PRICE' },
    					{ label: 'Fair Deal', value: 'FAIR_PRICE' }
    				 }
    				onChange={ onChangeMinimumRating }
    			/>

    This is the correct syntax:

    			<SelectControl
    				label="Minimum Rating"
    				value={ attributes.minimumRating }
    				options={ [
    					{ label: 'Great Deal', value: 'GREAT_PRICE' },
    					{ label: 'Good Deal', value: 'GOOD_PRICE' },
    					{ label: 'Fair Deal', value: 'FAIR_PRICE' }
    				] }
    				onChange={ onChangeMinimumRating }
    			/>
  • Router Circle Jig Calculator

    Router Circle Jig Calculator

    I recently gifted myself a Bosch 1617EVSPK router, and the first project is mounting it to a old Craftsman 171.253512 router table that came with the used contractor table saw I bought myself for my 37th birthday.

    An adapter plate is needed. None of the threaded mounting holes on the fixed router base line up with holes in the table. A friend advised me to cut the plate out of metal or acrylic rather than wood. I may do that. First, I’m making a prototype out of 1/2 inch birch plywood.

    The challenge is that a hole is needed in the center to line up with the hole in the center of the router table. The hole is 2 and 7/8 inches. The first thing you learn when you get a router is that you need a guide for every cut. To cut a hole, you need a bigger hole, or circle jig, in which to run the tool.

    How Big of a Hole do I need to cut a Hole?

    What size circle jig is needed to cut a 2 and 7/8″ circle? Well, what size is the router base plate, and what size is the bit? The answer for me was 9 inches. I made a circle jig calculator spreadsheet to help you calculate your own answer: https://docs.google.com/spreadsheets/d/1j-HHztDr0gRN3G3gc9z6VhBRuo2sOvzG_dBccMmtVgg/edit?usp=sharing

    A screenshot of a calculator built in a Google Sheet

    Is this silly? Is there an easier way to do this? Please, let me know.