title: Multiple props type, Type 'any' is not assignable to type 'never'
body: <p>Sorry I don't know exactly how to name this post.</p>
  
  <p>Using react and typescript :
  I have a component that create a set a component based on a type I pass as props : </p>
  
  <pre><code>interface FieldDispatcherProps {
    children: Array&lt;never&gt;;
    fieldId: string;
    mandatory?: boolean;
    mode: FieldMode;
    onChange: Function;
  }
  
  const fieldTypes = {
    [FieldsHelper.fields.text.value] : TextField,
    [FieldsHelper.fields.textarea.value] : TextAreaField,
    [FieldsHelper.fields.select.value] : SelectField,
    [FieldsHelper.fields.radio.value] : RadioField,
    [FieldsHelper.fields.checkbox.value] : CheckboxField,
    [FieldsHelper.fields.autonum.value] : AutonumField,
    [FieldsHelper.fields.number.value] : NumberField,
    [FieldsHelper.fields.file.value] : FileField,
    [FieldsHelper.fields.calc.value] : CalcField,
    [FieldsHelper.fields.user.value] : UserField,
    [FieldsHelper.fields.dslookup.value] : LookupField,
    [FieldsHelper.fields.date.value] : DateField,
    [FieldsHelper.fields.time.value] : TimeField,
  }
  
  const FieldDispatcher = (props: FieldDispatcherProps): JSX.Element =&gt; {
    const {fieldId, mandatory, mode, onChange}: FieldDispatcherProps = props;
    const field = useSelector((state: RootState) =&gt; ItemDetailsSelectors.getFieldById(state))(fieldId);
    const value = useSelector((state: RootState) =&gt; ItemDetailsSelectors.getEntryValue(state))(fieldId);
    return (
      &lt;div&gt;
        {((): JSX.Element  =&gt; {
          const FieldType = fieldTypes[field.dataType];
          if(FieldType) {
            return &lt;FieldType onChange={onChange} mode={mode} mandatory={mandatory} field={field} value={value} fieldId={fieldId}/&gt;
          } else {
            return &lt;div&gt;{value}&lt;/div&gt;;
          }
        })()}
      &lt;/div&gt;
    )
  }
  </code></pre>
  
  <p>Now, Every field as the same props name, but, the prop named <code>value</code> is of a different type in each component. Some expect an array, other a string, other num....</p>
  
  <p>The problem I face is </p>
  
  <pre><code>        const FieldType = fieldTypes[field.dataType];
          if(FieldType) {
            return &lt;FieldType onChange={onChange} mode={mode} mandatory={mandatory} field={field} value={value} fieldId={fieldId}/&gt;
          } else {
            return &lt;div&gt;{value}&lt;/div&gt;;
          }
  </code></pre>
  
  <p>Return the following error for the props value:</p>
  
  <blockquote>
    <p>Type 'any' is not assignable to type 'never'.</p>
  </blockquote>
  
  <p>If I set all my child to expect a value of type any it works, but I would like to keep the child type.</p>
  
  <p>IS there a way ? </p>