├── CHANGELOG.md ├── LICENSE.txt ├── README.md ├── blaze-react-component ├── .versions ├── blaze-react-component-client.js ├── blaze-react-component-server.js └── package.js ├── circle.yml └── test-app ├── .gitignore ├── .meteor ├── .finished-upgraders ├── .gitignore ├── .id ├── packages ├── platforms ├── release └── versions ├── client ├── main.html └── main.spec.js ├── package-lock.json ├── package.json ├── packages └── blaze-react-component └── server ├── main.html └── main.spec.js /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. 3 | This project adheres to [Semantic Versioning](http://semver.org/). 4 | 5 | ## [Unreleased] 6 | 7 | ### Fixed 8 | * React 17 deprecates `componentWillReceiveProps()`. Consequently, 9 | `blazeData.set()` was moved to `shouldComponentUpdate()` to avoid 10 | deprecation warnings in React > 16.3. Thanks @vjau for letting us 11 | know about this (#21). 12 | 13 | For more info, see also: 14 | https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html 15 | 16 | ## [1.4.2] - 2019-02-19 17 | ### Fixed 18 | * Fixed incompatibility with 19 | [peerlibrary:blaze-components](http://components.meteorapp.com/) 20 | by avoiding the name collision on `BlazeComponent`. Thanks, @duce3! 21 | (#18, #19) 22 | 23 | ## [1.4.1] - 2018-06-28 24 | ### Fixed 25 | * We now explicitly depend on `underscore`, which since Meteor 1.7, is no longer 26 | a default package. Thanks, @MaxGuitet! (#16) 27 | 28 | ## [1.4.0] - 2016-10-31 29 | ### Added 30 | * We now support the case where the `template` property is changed. Previously 31 | this had no effect, but now the newly requested template will be rendered in 32 | place. Useful for router actions where the template can vary. Thanks, 33 | @lmachens. (#8) 34 | 35 | ## [1.3.0] - 2016-10-06 36 | ### Added 37 | * Support a `className` parameter to set the `class` attribute on the `` 38 | tag. Thanks, @Praxie. (#6) 39 | 40 | ## [1.2.0] - 2016-08-10 41 | ### Added 42 | * If the template argument is a string name, and it doesn't exist, we 43 | warn the user to ensure the `templating` packing is installed. 44 | * Ability to pass a Blaze.Template instance directly to the component's 45 | template arg, and if neither that nor a string is provided, throw a 46 | clear error. 47 | 48 | ## [1.1.2] - 2016-08-09 49 | ### Fixed 50 | * Require `templating` as a direct package dep instead of assuming the user is 51 | using templates in their app, fixes #5. 52 | 53 | ## [1.1.1] - 2016-03-31 54 | ### Changed 55 | - We now render into a `` instead of a `
`. This should be a 56 | transparent change in most cases, although I apologize if you have to re-fix 57 | any CSS you might have used to work around the original un-intended 58 | behaviour. 59 | 60 | ## [1.1.0] - 2016-03-26 61 | ### Added 62 | - A `blazeToReact()` shortcut for those that want it, see the notes in the 63 | README. 64 | 65 | ## 1.0.0 - 2016-03-21 66 | 67 | Initial release. 68 | 69 | [Unreleased]: https://github.com/gadicc/meteor-blaze-react-component/compare/v1.2.0...HEAD 70 | [1.2.0]: https://github.com/gadicc/meteor-blaze-react-component/compare/v1.1.2...v1.1.0 71 | [1.1.2]: https://github.com/gadicc/meteor-blaze-react-component/compare/v1.1.1...v1.1.2 72 | [1.1.1]: https://github.com/gadicc/meteor-blaze-react-component/compare/v1.1.0...v1.1.1 73 | [1.1.0]: https://github.com/gadicc/meteor-blaze-react-component/compare/v1.0.0...v1.1.0 74 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 by Gadi Cohen 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # blaze-react-component [![Circle CI](https://circleci.com/gh/gadicc/meteor-blaze-react-component.svg?style=shield)](https://circleci.com/gh/gadicc/meteor-blaze-react-component) ![MIT License](https://img.shields.io/badge/license-MIT-blue.svg) 2 | 3 | *Use Blaze templates inside of React* 4 | 5 | Copyright (c) 2016 by Gadi Cohen and released under the 6 | MIT license (see [LICENSE.txt](./LICENSE.txt)). Many thanks to all our 7 | [contributors](https://github.com/gadicc/meteor-blaze-react-component/graphs/contributors). 8 | 9 | ## Installation 10 | 11 | ``` 12 | # v2+ is Meteor v3 only. Use v1 for Meteor 1 and 2. 13 | meteor add gadicc:blaze-react-component 14 | ``` 15 | 16 | ## Usage 17 | 18 | ```jsx 19 | import React from 'react'; 20 | import Blaze from 'meteor/gadicc:blaze-react-component'; 21 | 22 | const App = () => ( 23 |
24 | 25 |
26 | ); 27 | ``` 28 | 29 | **If you want to use Blaze templates from your *app* (as opposed to a package), 30 | make sure you have the `templating` package installed (and not, i.e. the 31 | `static-html` package).** 32 | 33 | Your Blaze template will be rendered into a `` tag. If needed, you can 34 | specify a `className` attribute, i.e. 35 | 36 | ```html 37 | 38 | ``` 39 | 40 | renders to: 41 | 42 | ```html 43 | myTemplate content 44 | ``` 45 | 46 | ## Troubleshooting 47 | 48 | 1. **Uncaught Error: No Template["xxx"] exists** 49 | 50 | If your template `xxx` exists in a `.html` file inside your `client` directory, Meteor won't automatically import it, and you should `import` it from the same react `.js` file where you need it, e.g. 51 | 52 | ```js 53 | // This file contains