Closed Frost-on-Web closed 1 year ago
Hello @Frost-on-Web, thanks for opening the PR, and especially for explaining your need in details.
I'm not going to merge it because I'm planning on updating this package to use the types from @strapi/types
, instead of defining them here in this repo.
But there are 2 ways you can get access to that type:
@strapi/types
package:import type { Attribute } from '@strapi/types';
type RootNode = Attribute.BlocksValue;
import * as React from 'react';
import { BlocksRenderer } from '@strapi/blocks-react-renderer';
type RootNode = React.ComponentProps<typeof BlocksRenderer>['content'];
I haven't actually tried these, so apologies if there's any error. I hope this helps!
@remidej we do not advise people to access types form that package.
They're always re-exported from strapi/strapi - that could be an offering, but honestly I would have had them exported from here because you're making using this package potentially dependant on using CMS packages with a strict release cycle... which imo makes having this package in its own repo, redundant.
Also a mismatch in package versions could break usr applications 🙂
Happy to meet and discuss, LMK.
If we display the RootNode type, it can be easily used into custom interfaces which are useful to define any API inputs.
What does it do?
Just display the RootNode type in order to use it to define my API input type 👍
How to test it?
Please be kind
Hi, it is one my first PR of all time and English is not my first language so please apologize my lack of verbosity. Hoping to be helpful.