How to use the @sitecore-jss/sitecore-jss-react.getFieldValue function in @sitecore-jss/sitecore-jss-react

To help you get started, we’ve selected a few @sitecore-jss/sitecore-jss-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Sitecore / jss / samples / react / src / components / Styleguide-FieldUsage-Number / index.js View on Github external
const StyleguideFieldUsageText = (props) => {
  const fieldValue = getFieldValue(props.fields, 'sample');

  return (
    
      {/* Basic emission of a number field for editing can be done with the 
  );
};
github Sitecore / jss / samples / react / src / components / Styleguide-FieldUsage-Checkbox / index.js View on Github external
*/}
      {props.fields &&
        props.fields.checkbox &&
        props.fields.checkbox.value && (
          <li>
            <code>checkbox</code> is true
          </li>
        )}
      {!props.fields ||
        !props.fields.checkbox ||
        (!props.fields.checkbox.value &amp;&amp; (
          <li>
            <code>checkbox</code> is false
          </li>
        ))}
      {getFieldValue(props.fields, 'checkbox2', false) &amp;&amp; (
        <li>
          <code>checkbox2</code> is true
        </li>
      )}
      {!getFieldValue(props.fields, 'checkbox2', false) &amp;&amp; (
        <li>
          <code>checkbox2</code> is false
        </li>
      )}
    
  
);
github Sitecore / jss / samples / react / src / components / Styleguide-FieldUsage-Checkbox / index.js View on Github external
<code>checkbox</code> is true
          
        )}
      {!props.fields ||
        !props.fields.checkbox ||
        (!props.fields.checkbox.value &amp;&amp; (
          <li>
            <code>checkbox</code> is false
          </li>
        ))}
      {getFieldValue(props.fields, 'checkbox2', false) &amp;&amp; (
        <li>
          <code>checkbox2</code> is true
        </li>
      )}
      {!getFieldValue(props.fields, 'checkbox2', false) &amp;&amp; (
        <li>
          <code>checkbox2</code> is false
        </li>
      )}
    
  
);

@sitecore-jss/sitecore-jss-react

This module is provided as a part of Sitecore JavaScript Rendering SDK (JSS). It contains React components and integration for JSS.

Apache-2.0
Latest version published 7 days ago

Package Health Score

66 / 100
Full package analysis

Similar packages