I’ve finished my first react component which runs successfully and acts as expected: https://github.com/SterlingButters/plaidash
For some reason, nothing is rendered in Python by running usage.py
. The JS console doesn’t show anything out of the ordinary either. The only thing to note really was an error at build:
Error with path src/lib/components/LoginForm.react.jsTypeError: Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at checkWarn (/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/dash/extract-meta.js:45:15)
at Object.entries.forEach (/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/dash/extract-meta.js:54:24)
at Array.forEach (<anonymous>)
at docstringWarning (/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/dash/extract-meta.js:53:31)
at parseFile (/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/dash/extract-meta.js:70:9)
at dirs.forEach.filename (/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/dash/extract-meta.js:92:17)
at Array.forEach (<anonymous>)
at collectMetadataRecursively (/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/dash/extract-meta.js:87:14)
at componentPaths.forEach.componentPath (/Users/sterlingbutters/anaconda3/lib/python3.6/site-packages/dash/extract-meta.js:21:5)
at Array.forEach (<anonymous>)
The only other root cause I can think of has to do with property definitions in python of the react component.
How are properties inserted into the App
class of the React component with Python? Currently, I have some properties already defined in the react component:
render() {
return (
<LoginForm
id="Test"
access_token={this.state.access_token}
clientName="Plaid Client"
env="sandbox"
product={['auth', 'transactions']}
publicKey="7a3daf1db208b7d1fe65850572****"
apiVersion="v2"
onTokenUpdate={this.handleUpdateToken}
>
</LoginForm>
);
}
and in python I try to “overwrite” those:
@app.callback(Output('login-container', 'children'),
[Input('open-form-button', 'n_clicks'),])
def display_output(clicks):
if clicks is not None and clicks > 0:
return plaidash.LoginForm(
id='plaid-link',
clientName='Butters',
env='sandbox',
publicKey='7a3daf1db208b7d1fe65850572****',
product=['auth', 'transactions'],
),
is this valid?
Thanks for any/all help