We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the blocks need to be independent that is why some code are simply duplicated such as
function initReactComponents() { const items = document.querySelectorAll('.wp-block-inseri-core-download') if (items) { Array.from(items).forEach((item: any) => { const attributes = JSON.parse(item.dataset.attributes) createRoot(item!).render( <InseriThemeProvider> <RecoilRoot> <InseriRoot blockId={attributes.blockId} blockName={attributes.blockName} blockType={config.name}> <View attributes={attributes} /> </InseriRoot> </RecoilRoot> </InseriThemeProvider> ) }) } }
export default function Edit(props: BlockEditProps<Attributes>) { const { setAttributes, attributes, clientId } = props return ( <SetupEditorEnv {...props} baseBlockName={'html'} addSuffixToInputs={['inputKey']}> <InseriRoot blockId={attributes.blockId} blockName={attributes.blockName} blockType={json.name} clientId={clientId}> <StateProvider stateCreator={storeCreator} keysToSave={Object.keys(json.attributes)} setAttributes={setAttributes} initialState={attributes}> <EditComponent {...props} /> </StateProvider> </InseriRoot> </SetupEditorEnv> ) }
maybe one could reduce duplication through macro
The text was updated successfully, but these errors were encountered:
No branches or pull requests
the blocks need to be independent that is why some code are simply duplicated such as
maybe one could reduce duplication through macro
The text was updated successfully, but these errors were encountered: