How to use the ra-core.InferredElement function in ra-core

To help you get started, we’ve selected a few ra-core 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 bootstrap-styled / ra-ui / src / components / list / ListGuesser.js View on Github external
componentDidUpdate() {
    const { ids, data, resource } = this.props;
    if (ids.length > 0 && data && !this.state.inferredChild) {
      const inferredElements = getElementsFromRecords(
        ids.map(id => data[id]),
        listFieldTypes
      );
      const inferredChild = new InferredElement(
        listFieldTypes.table,
        null,
        inferredElements
      );

      process.env.NODE_ENV !== 'production' && // eslint-disable-line
      // eslint-disable-next-line no-console
      console.log(
        `Guessed List:

export const ${inflection.capitalize(
    inflection.singularize(resource)
  )}List = props => (
    
${inferredChild.getRepresentation()}
github marmelab / react-admin / packages / ra-ui-materialui / src / detail / ShowGuesser.js View on Github external
useEffect(() => {
        if (record && !inferredChild) {
            const inferredElements = getElementsFromRecords(
                [record],
                showFieldTypes
            );
            const inferredChild = new InferredElement(
                showFieldTypes.show,
                null,
                inferredElements
            );

            process.env.NODE_ENV !== 'production' &&
                // eslint-disable-next-line no-console
                console.log(
                    `Guessed Show:

export const ${inflection.capitalize(
                        inflection.singularize(resource)
                    )}Show = props => (
    
${inferredChild.getRepresentation()}
github bootstrap-styled / ra-ui / src / components / detail / EditGuesser.js View on Github external
componentDidUpdate() {
    const { record, resource } = this.props;
    if (record && !this.state.inferredChild) {
      const inferredElements = getElementsFromRecords(
        [record],
        editFieldTypes
      );
      const inferredChild = new InferredElement(
        editFieldTypes.form,
        null,
        inferredElements
      );

      process.env.NODE_ENV !== 'production' // eslint-disable-line
      // eslint-disable-next-line no-console
      && console.log(
        `Guessed Edit:

export const ${inflection.capitalize(
    inflection.singularize(resource)
  )}Edit = props => (
    
${inferredChild.getRepresentation()}
github marmelab / react-admin / packages / ra-ui-materialui / src / list / ListGuesser.js View on Github external
componentDidUpdate() {
        const { ids, data, resource } = this.props;
        if (ids.length > 0 && data && !this.state.inferredChild) {
            const inferredElements = getElementsFromRecords(
                ids.map(id => data[id]),
                listFieldTypes
            );
            const inferredChild = new InferredElement(
                listFieldTypes.table,
                null,
                inferredElements
            );

            process.env.NODE_ENV !== 'production' &&
                // eslint-disable-next-line no-console
                console.log(
                    `Guessed List:

export const ${inflection.capitalize(
                        inflection.singularize(resource)
                    )}List = props => (
    
${inferredChild.getRepresentation()}
github marmelab / react-admin / packages / ra-ui-materialui / src / detail / EditGuesser.js View on Github external
useEffect(() => {
        if (record && !inferredChild) {
            const inferredElements = getElementsFromRecords(
                [record],
                editFieldTypes
            );
            const inferredChild = new InferredElement(
                editFieldTypes.form,
                null,
                inferredElements
            );

            process.env.NODE_ENV !== 'production' &&
                // eslint-disable-next-line no-console
                console.log(
                    `Guessed Edit:

export const ${inflection.capitalize(
                        inflection.singularize(resource)
                    )}Edit = props => (
    
${inferredChild.getRepresentation()}
github bootstrap-styled / ra-ui / src / components / detail / ShowGuesser.js View on Github external
componentDidUpdate() {
    const { record, resource } = this.props;
    if (record && !this.state.inferredChild) {
      const inferredElements = getElementsFromRecords(
        [record],
        showFieldTypes
      );
      const inferredChild = new InferredElement(
        showFieldTypes.show,
        null,
        inferredElements
      );

      process.env.NODE_ENV !== 'production' // eslint-disable-line
      // eslint-disable-next-line no-console
      && console.log(
        `Guessed Show:

export const ${inflection.capitalize(
    inflection.singularize(resource)
  )}Show = props => (
    
${inferredChild.getRepresentation()}