Skip to content
This repository was archived by the owner on Aug 12, 2021. It is now read-only.

Conversation

jgrancher
Copy link
Owner

@jgrancher jgrancher commented May 1, 2017

This PR aims to gather few changes to prepare for [email protected].
This is a major bump as few of the changes listed below are breaking changes.
In fact, quite a few methods and properties have been renamed, but the API won't change that much anymore, hopefully. 😇

REMOVED:

  • The clearButtonHidden property and the internal _clearButton view have been removed. This is because the clear method has now to be called from an outside component (that was the goal for a long time!).

CHANGED:

  • React Native >= 0.40 is now compatible out of the box. This is a breaking change for people using with in an older version of React Native (Hotfix: React Native 0.40 compatibility #20).
  • The fillColor property has been changed to be null by default, in order to get a transparent background out of the box.
  • The imageType property to export the drawing is now png by default, in the same effort for a transparent background. You can still set it to jpg if you want.
  • The onReset event callback has been renamed to onClear.
  • The saveImage method has been renamed to save AND doesn't require any argument anymore. We keep the state of the drawing in the bridge for you, so that you don't need to keep a reference of the encoded representation of the image on every change. The onChange still exists, and is still returning the base64 representation of the drawing, but you don't have to save it into your component's state in order to pass it to save later on.
  • The two methods clear and save are now Promises, allowing you to type:
this.sketch.clear().then(() => console.log('Thanks for drawing with us.'));
this.sketch.save().then(image => console.log(`Here is your drawing image: ${image.path}`));
  • Code cleanup (from Thinkmill@5bab7f2).
  • The README.md has been updated with more documentation.

ADDED:

  • An examples folder has been created.

Let me know your thoughts!
(I'm thinking of you guys who helped me before: @blargity @vccabral @stantoncbradley @gensc004 @alexsotocx)

@mitchheddles
Copy link

Nice!

@satyrius
Copy link

satyrius commented May 24, 2017

Do you have a roadmap and timeline to release this PR?

@jgrancher
Copy link
Owner Author

@satyrius I just need to add a bit of documentation & examples, but i'll do that soon! (I say that every time though 😄 )

@peacechen
Copy link
Contributor

Hope you will consider merging PR #31 to support both RN >= 0.40 as well as RN <= 0.39.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants