Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    REACT TabSet bug

    I tried this example https://smartclient.com/smartclient-...id=titleChange in REACT and I get an error in the debugging console
    Uncaught RangeError: Maximum call stack size exceeded
    at DynamicForm._cloneValue (ReactComponent.js:1263:1)
    at DynamicForm._cloneObject (ReactComponent.js:1250:1)
    my sourcecode
    Code:
    import React, { Component } from 'react';
    import { CheckboxItem, DynamicForm, Tab, TabSet, TextItem } from 'smartclient-pro/react';
    class App extends Component {
      constructor(param) {
        super(param);
      };
      onYourNameChange = function (form, item, value) {
        if (value)
          window.tabSet.setTabTitle(1, value + '\'s Preferences');
        else
          window.tabSet.setTabTitle(1, 'Preferences');
      };
      render() {
        return (
          <>
            <TabSet ID="tabSet" width="400" height="200">
              <tabs>
                <Tab title="Profile" id="profile">
                  <pane>
                    <DynamicForm ID="profilePane">
                      <fields>
                        <TextItem name="yourName" title="Your Name" change={this.onYourNameChange} />
                      </fields>
                    </DynamicForm>
                  </pane>
                </Tab>
                <Tab title="Preferences" id="preferences">
                  <pane>
                    <DynamicForm ID="preferencesPane">
                      <fields>
                        <CheckboxItem defaultValue="true" name="useISCTabs" title="Use SmartClient tabs" />
                      </fields>
                    </DynamicForm>
                  </pane>
                </Tab>
              </tabs>
            </TabSet>
          </>
        );
      }
    }
    export default App;
    Version SNAPSHOT_v13.1d_2024-04-17/Pro Deployment (2024-04-17)

    #2
    We've made a change to avoid the infinite recursion and it will be in the nightly builds for SC 13.1 dated 2024-05-08 and beyond.

    Note that we see your issue if the code is run as a standalone React app, but not when run within our Showcase as a React sample. Is this also what you see?

    Comment


      #3
      Your example works for me without errors. The error appears only in my REACT example

      Comment


        #4
        In my REACT example, everything is working now too

        Comment

        Working...
        X