Coder Social home page Coder Social logo

hidekih / editorjs-viewer-native Goto Github PK

View Code? Open in Web Editor NEW
36.0 36.0 3.0 2.91 MB

A React Native solution to parse outputData generated by EditorJs.

Home Page: https://www.npmjs.com/package/editorjs-viewer-native

License: MIT License

TypeScript 99.77% JavaScript 0.23%
editorjs react-native typescript

editorjs-viewer-native's Issues

Info required on Paragraph Component (Not a Bug)

I am using a Paragraph component to render the text with styles. i.e

const EditorJsParagraph = (props: IParagraphProps) => {
	const { text } = props.data;

	return <VHtmlText text={text} textClass="text-base text-52 dark:text-52" />;
};
export default EditorJsParagraph;

I need to change the text color based on Light and dark mode. How can I pass the information to EditorJsParagraph component so that I can change the text color?

Desired Behaviour:

if (darkMode) {
return <VHtmlText text={text} textClass="text-base text-52 dark:text-52" />;
}
return <VHtmlText text={text} textClass="text-base text-50 dark:text-50" />;

Setup

const EditorJsViewerNative = createEditorJsViewer({
	tools: {
		header: { Component: EditorJsHeader },
		paragraph: { Component: EditorJsParagraph },
		list: { Component: EditorJsList },
		image: { Component: EditorJsImage }
	},
	showBlockFallback: true
});

Expo Console Error

VirtualizedLists should never be nested inside plain ScrollViews with the same orientation because it can break windowing and other functionality - use another VirtualizedList-backed container instead.

my code

      <ScrollView>
             <EditorJsViewerNative data={{blocks:JSON.parse(data.content)}} />
      </ScrollView>

Getting react native warning

Thanks for the package, it works great.
I have a small issue.

Usage:

const EditorJsViewerNative = createEditorJsViewer();
<EditorJsViewerNative data={{ blocks: JSON.parse(text) }} />

Data:

 LOG  [{"data": {"text": "test"}, "id": "97LefH_cM3", "type": "paragraph"}]

How can I fix that?

Screenshot 2023-05-29 at 17 09 44

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.