Passing select control value to block

I managed to solve this by doing this: –

  1. Create a select control in the edit function.
{

  <SelectControl
      label="Size"
      value={ size }
      options={ [
          { label: 'Display 1', value: 'display-1' },
          { label: 'Display 2', value: 'display-2' },
          { label: 'Display 3', value: 'display-3' },
          { label: 'Display 4', value: 'display-4' },
      ] }
   onChange={ ( size ) => props.setAttributes( { size: size } ) }
      />

}
  1. Create an attribute (size)
  2. Change the select control to change the size attribute
  3. Pass the props to the save function props.attributes.size